-
-
Notifications
You must be signed in to change notification settings - Fork 736
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature] Voice channel status support (#2777)
* initial commit * MOCKED CHANNELS AGRHHHHHHHH * fix for sharded * yup
- Loading branch information
Showing
30 changed files
with
323 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Discord.API.Rest; | ||
|
||
internal class ModifyVoiceStatusParams | ||
{ | ||
[JsonProperty("status")] | ||
public string Status { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/VoiceChannelStatusDeletedAuditLogData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using EntryModel = Discord.API.AuditLogEntry; | ||
using Model = Discord.API.AuditLog; | ||
|
||
namespace Discord.Rest; | ||
|
||
/// <summary> | ||
/// Contains a piece of audit log data related to a voice channel status delete. | ||
/// </summary> | ||
public class VoiceChannelStatusDeletedAuditLogData : IAuditLogData | ||
{ | ||
private VoiceChannelStatusDeletedAuditLogData(ulong channelId) | ||
{ | ||
ChannelId = channelId; | ||
} | ||
|
||
internal static VoiceChannelStatusDeletedAuditLogData Create(BaseDiscordClient discord, EntryModel entry, Model log = null) | ||
{ | ||
return new (entry.TargetId!.Value); | ||
} | ||
|
||
/// <summary> | ||
/// Get the id of the channel status was removed in. | ||
/// </summary> | ||
public ulong ChannelId { get; } | ||
} |
31 changes: 31 additions & 0 deletions
31
src/Discord.Net.Rest/Entities/AuditLogs/DataTypes/VoiceChannelStatusUpdateAuditLogData.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using EntryModel = Discord.API.AuditLogEntry; | ||
using Model = Discord.API.AuditLog; | ||
|
||
namespace Discord.Rest; | ||
|
||
/// <summary> | ||
/// Contains a piece of audit log data related to a voice channel status update. | ||
/// </summary> | ||
public class VoiceChannelStatusUpdateAuditLogData : IAuditLogData | ||
{ | ||
private VoiceChannelStatusUpdateAuditLogData(string status, ulong channelId) | ||
{ | ||
Status = status; | ||
ChannelId = channelId; | ||
} | ||
|
||
internal static VoiceChannelStatusUpdateAuditLogData Create(BaseDiscordClient discord, EntryModel entry, Model log = null) | ||
{ | ||
return new (entry.Options.Status, entry.TargetId!.Value); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the status that was set in the voice channel. | ||
/// </summary> | ||
public string Status { get; } | ||
|
||
/// <summary> | ||
/// Get the id of the channel status was updated in. | ||
/// </summary> | ||
public ulong ChannelId { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Discord.Net.WebSocket/API/Gateway/VoiceChannelStatusUpdateEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Discord.API.Gateway; | ||
|
||
internal class VoiceChannelStatusUpdateEvent | ||
{ | ||
[JsonProperty("id")] | ||
public ulong Id { get; set; } | ||
|
||
[JsonProperty("guild_id")] | ||
public ulong GuildId { get; set; } | ||
|
||
[JsonProperty("status")] | ||
public string Status { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.