From 646834eb133fe8a6f288b191258d53c66eac1f57 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:32:25 +0200 Subject: [PATCH 01/36] Added GuildMessagePolls and DirectMessagePolls to GatewayIntents, as well as detailed documentation for all intents. --- NetCord/Gateway/GatewayIntents.cs | 146 +++++++++++++++++++++++++----- 1 file changed, 122 insertions(+), 24 deletions(-) diff --git a/NetCord/Gateway/GatewayIntents.cs b/NetCord/Gateway/GatewayIntents.cs index decb178c..ffade8b5 100644 --- a/NetCord/Gateway/GatewayIntents.cs +++ b/NetCord/Gateway/GatewayIntents.cs @@ -1,55 +1,143 @@ namespace NetCord.Gateway; +/// +/// Intents are used to configure which events are passed to the bot via the gateway connection. Intents marked as privileged must be enabled in the application developer portal before being passed here, otherwise the connection will terminate with close code 4014. +/// [Flags] public enum GatewayIntents : uint { + /// + /// Associated with the following events:
+ /// • Guild Events: GUILD_CREATE, GUILD_UPDATE, GUILD_DELETE, GUILD_ROLE_CREATE, GUILD_ROLE_UPDATE, GUILD_ROLE_DELETE
+ /// • Channel Events: CHANNEL_CREATE, CHANNEL_UPDATE, CHANNEL_DELETE, CHANNEL_PINS_UPDATE
+ /// • Thread Events: THREAD_CREATE, THREAD_UPDATE, THREAD_DELETE, THREAD_LIST_SYNC, THREAD_MEMBER_UPDATE, THREAD_MEMBERS_UPDATE
+ /// • Stage Events: STAGE_INSTANCE_CREATE, STAGE_INSTANCE_UPDATE, STAGE_INSTANCE_DELETE + ///
Guilds = 1 << 0, + /// - /// Privileged + /// Privileged, associated with the following events:
+ /// GUILD_MEMBER_ADD, GUILD_MEMBER_UPDATE, GUILD_MEMBER_REMOVE, THREAD_MEMBERS_UPDATE ///
GuildUsers = 1 << 1, + + /// + /// Associated with the following events:
+ /// GUILD_AUDIT_LOG_ENTRY_CREATE, GUILD_BAN_ADD, GUILD_BAN_REMOVE + ///
GuildModeration = 1 << 2, + + /// + /// Associated with the following events:
+ /// GUILD_EMOJIS_UPDATE, GUILD_STICKERS_UPDATE + ///
GuildEmojisAndStickers = 1 << 3, + + /// + /// Associated with the following events:
+ /// GUILD_INTEGRATIONS_UPDATE, INTEGRATION_CREATE, INTEGRATION_UPDATE, INTEGRATION_DELETE + ///
GuildIntegrations = 1 << 4, + + /// + /// Associated with the following events:
+ /// WEBHOOKS_UPDATE + ///
GuildWebhooks = 1 << 5, + + /// + /// Associated with the following events:
+ /// INVITE_CREATE, INVITE_DELETE + ///
GuildInvites = 1 << 6, + + /// + /// Associated with the following events:
+ /// VOICE_STATE_UPDATE + ///
GuildVoiceStates = 1 << 7, + /// - /// Privileged + /// Privileged, ssociated with the following events:
+ /// PRESENCE_UPDATE ///
GuildPresences = 1 << 8, + + /// + /// Associated with the following events:
+ /// MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, MESSAGE_DELETE_BULK + ///
GuildMessages = 1 << 9, + + /// + /// Associated with the following events:
+ /// MESSAGE_REACTION_ADD, MESSAGE_REACTION_REMOVE, MESSAGE_REACTION_REMOVE_ALL, MESSAGE_REACTION_REMOVE_EMOJI + ///
GuildMessageReactions = 1 << 10, + + /// + /// Associated with the following events:
+ /// TYPING_START + ///
GuildMessageTyping = 1 << 11, + + /// + /// Associated with the following events:
+ /// MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, CHANNEL_PINS_UPDATE + ///
DirectMessages = 1 << 12, + + /// + /// Associated with the following events:
+ /// MESSAGE_REACTION_ADD, MESSAGE_REACTION_REMOVE, MESSAGE_REACTION_REMOVE_ALL, MESSAGE_REACTION_REMOVE_EMOJI + ///
DirectMessageReactions = 1 << 13, + + /// + /// Associated with the following events:
+ /// TYPING_START + ///
DirectMessageTyping = 1 << 14, + /// - /// Privileged + /// Privileged, ssociated with the following events:
+ /// MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, CHANNEL_PINS_UPDATE ///
MessageContent = 1 << 15, + + /// + /// Associated with the following events:
+ /// GUILD_SCHEDULED_EVENT_CREATE, GUILD_SCHEDULED_EVENT_UPDATE, GUILD_SCHEDULED_EVENT_DELETE, GUILD_SCHEDULED_EVENT_USER_ADD, GUILD_SCHEDULED_EVENT_USER_REMOVE + ///
GuildScheduledEvents = 1 << 16, + + /// + /// Associated with the following events:
+ /// AUTO_MODERATION_RULE_CREATE, AUTO_MODERATION_RULE_UPDATE, AUTO_MODERATION_RULE_DELETE + ///
AutoModerationConfiguration = 1 << 20, + + /// + /// Associated with the following events:
+ /// AUTO_MODERATION_ACTION_EXECUTION + ///
AutoModerationExecution = 1 << 21, - All = Guilds - | GuildUsers - | GuildModeration - | GuildEmojisAndStickers - | GuildIntegrations - | GuildWebhooks - | GuildInvites - | GuildVoiceStates - | GuildPresences - | GuildMessages - | GuildMessageReactions - | GuildMessageTyping - | DirectMessages - | DirectMessageReactions - | DirectMessageTyping - | MessageContent - | GuildScheduledEvents - | AutoModerationConfiguration - | AutoModerationExecution, + + /// + /// Associated with the following events:
+ /// MESSAGE_POLL_VOTE_ADD, MESSAGE_POLL_VOTE_REMOVE + ///
+ GuildMessagePolls = 1 << 24, + + /// + /// Associated with the following events:
+ /// MESSAGE_POLL_VOTE_ADD, MESSAGE_POLL_VOTE_REMOVE + ///
+ DirectMessagePolls = 1 << 25, + + /// + /// Implies all available intents, excluding privileged intents. + /// AllNonPrivileged = Guilds | GuildModeration | GuildEmojisAndStickers @@ -65,5 +153,15 @@ public enum GatewayIntents : uint | DirectMessageTyping | GuildScheduledEvents | AutoModerationConfiguration - | AutoModerationExecution, -} + | AutoModerationExecution + | GuildMessagePolls + | DirectMessagePolls, + + /// + /// Implies all available intents, including privileged intents. + /// + All = AllNonPrivileged + | GuildUsers + | GuildPresences + | MessageContent, +} \ No newline at end of file From a69db67598354dc084db7f20c9513508953fa161 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:36:37 +0200 Subject: [PATCH 02/36] EOF moved. Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Gateway/GatewayIntents.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayIntents.cs b/NetCord/Gateway/GatewayIntents.cs index ffade8b5..c811349d 100644 --- a/NetCord/Gateway/GatewayIntents.cs +++ b/NetCord/Gateway/GatewayIntents.cs @@ -164,4 +164,4 @@ public enum GatewayIntents : uint | GuildUsers | GuildPresences | MessageContent, -} \ No newline at end of file +} From 7b7b2800fab83475fbc24a2b53c36b60ed79d5fe Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:22:16 +0200 Subject: [PATCH 03/36] Rewrote the file to use `see` tags. --- NetCord/Gateway/GatewayIntents.cs | 66 +++++++++++++------------------ 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/NetCord/Gateway/GatewayIntents.cs b/NetCord/Gateway/GatewayIntents.cs index c811349d..f8adb185 100644 --- a/NetCord/Gateway/GatewayIntents.cs +++ b/NetCord/Gateway/GatewayIntents.cs @@ -1,140 +1,130 @@ -namespace NetCord.Gateway; +namespace NetCord.Gateway; /// -/// Intents are used to configure which events are passed to the bot via the gateway connection. Intents marked as privileged must be enabled in the application developer portal before being passed here, otherwise the connection will terminate with close code 4014. +/// Intents are used to configure which events are passed to the bot via the gateway connection. Intents marked as privileged must be enabled in the application developer portal before being passed here, otherwise the connection will terminate with close code 4014. /// [Flags] public enum GatewayIntents : uint { /// /// Associated with the following events:
- /// • Guild Events: GUILD_CREATE, GUILD_UPDATE, GUILD_DELETE, GUILD_ROLE_CREATE, GUILD_ROLE_UPDATE, GUILD_ROLE_DELETE
- /// • Channel Events: CHANNEL_CREATE, CHANNEL_UPDATE, CHANNEL_DELETE, CHANNEL_PINS_UPDATE
- /// • Thread Events: THREAD_CREATE, THREAD_UPDATE, THREAD_DELETE, THREAD_LIST_SYNC, THREAD_MEMBER_UPDATE, THREAD_MEMBERS_UPDATE
- /// • Stage Events: STAGE_INSTANCE_CREATE, STAGE_INSTANCE_UPDATE, STAGE_INSTANCE_DELETE + /// • Guild Events: , ,
+ /// • Role Events: , ,
+ /// • Channel Events: , , ,
+ /// • Thread Events: , , ,
+ /// • Thread User Events: ,
+ /// • Stage Events: , , ///
Guilds = 1 << 0, /// /// Privileged, associated with the following events:
- /// GUILD_MEMBER_ADD, GUILD_MEMBER_UPDATE, GUILD_MEMBER_REMOVE, THREAD_MEMBERS_UPDATE + /// , , , ///
GuildUsers = 1 << 1, /// /// Associated with the following events:
- /// GUILD_AUDIT_LOG_ENTRY_CREATE, GUILD_BAN_ADD, GUILD_BAN_REMOVE + /// , , ///
GuildModeration = 1 << 2, /// /// Associated with the following events:
- /// GUILD_EMOJIS_UPDATE, GUILD_STICKERS_UPDATE + /// , ///
GuildEmojisAndStickers = 1 << 3, /// /// Associated with the following events:
- /// GUILD_INTEGRATIONS_UPDATE, INTEGRATION_CREATE, INTEGRATION_UPDATE, INTEGRATION_DELETE + /// , , , ///
GuildIntegrations = 1 << 4, /// /// Associated with the following events:
- /// WEBHOOKS_UPDATE + /// ///
GuildWebhooks = 1 << 5, /// /// Associated with the following events:
- /// INVITE_CREATE, INVITE_DELETE + /// , ///
GuildInvites = 1 << 6, /// /// Associated with the following events:
- /// VOICE_STATE_UPDATE + /// ///
GuildVoiceStates = 1 << 7, /// /// Privileged, ssociated with the following events:
- /// PRESENCE_UPDATE + /// ///
GuildPresences = 1 << 8, /// /// Associated with the following events:
- /// MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, MESSAGE_DELETE_BULK + /// , , , ///
GuildMessages = 1 << 9, /// /// Associated with the following events:
- /// MESSAGE_REACTION_ADD, MESSAGE_REACTION_REMOVE, MESSAGE_REACTION_REMOVE_ALL, MESSAGE_REACTION_REMOVE_EMOJI + /// , , , ///
GuildMessageReactions = 1 << 10, /// /// Associated with the following events:
- /// TYPING_START + /// ///
GuildMessageTyping = 1 << 11, /// /// Associated with the following events:
- /// MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, CHANNEL_PINS_UPDATE + /// , , , ///
DirectMessages = 1 << 12, /// /// Associated with the following events:
- /// MESSAGE_REACTION_ADD, MESSAGE_REACTION_REMOVE, MESSAGE_REACTION_REMOVE_ALL, MESSAGE_REACTION_REMOVE_EMOJI + /// , , , ///
DirectMessageReactions = 1 << 13, /// /// Associated with the following events:
- /// TYPING_START + /// ///
DirectMessageTyping = 1 << 14, /// /// Privileged, ssociated with the following events:
- /// MESSAGE_CREATE, MESSAGE_UPDATE, MESSAGE_DELETE, CHANNEL_PINS_UPDATE + /// , , , ///
MessageContent = 1 << 15, /// /// Associated with the following events:
- /// GUILD_SCHEDULED_EVENT_CREATE, GUILD_SCHEDULED_EVENT_UPDATE, GUILD_SCHEDULED_EVENT_DELETE, GUILD_SCHEDULED_EVENT_USER_ADD, GUILD_SCHEDULED_EVENT_USER_REMOVE + /// , , , , ///
GuildScheduledEvents = 1 << 16, /// /// Associated with the following events:
- /// AUTO_MODERATION_RULE_CREATE, AUTO_MODERATION_RULE_UPDATE, AUTO_MODERATION_RULE_DELETE + /// , , ///
AutoModerationConfiguration = 1 << 20, /// /// Associated with the following events:
- /// AUTO_MODERATION_ACTION_EXECUTION + /// ///
AutoModerationExecution = 1 << 21, - /// - /// Associated with the following events:
- /// MESSAGE_POLL_VOTE_ADD, MESSAGE_POLL_VOTE_REMOVE - ///
- GuildMessagePolls = 1 << 24, - - /// - /// Associated with the following events:
- /// MESSAGE_POLL_VOTE_ADD, MESSAGE_POLL_VOTE_REMOVE - ///
- DirectMessagePolls = 1 << 25, - /// /// Implies all available intents, excluding privileged intents. /// @@ -153,9 +143,7 @@ public enum GatewayIntents : uint | DirectMessageTyping | GuildScheduledEvents | AutoModerationConfiguration - | AutoModerationExecution - | GuildMessagePolls - | DirectMessagePolls, + | AutoModerationExecution, /// /// Implies all available intents, including privileged intents. From 2a4fcb73e74e0bacb8f9965c902a4984cc4d9f15 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:47:32 +0200 Subject: [PATCH 04/36] Full documentation for all events in GatewayClient.cs --- NetCord/Gateway/GatewayClient.cs | 318 ++++++++++++++++++++++++++++++- 1 file changed, 308 insertions(+), 10 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 5e876c6b..2796cee1 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -17,71 +17,371 @@ public partial class GatewayClient : WebSocketClient, IEntity private readonly IGatewayCompression _compression; private readonly bool _disposeRest; + /// + /// The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions). + /// The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform. + /// public event Func? Ready; + + /// + /// Sent when an application command's permissions are updated. + /// The inner payload is an object. + /// public event Func? ApplicationCommandPermissionsUpdate; + + /// + /// Sent when a rule is created. + /// The inner payload is an object. + /// public event Func? AutoModerationRuleCreate; + + /// + /// Sent when a rule is updated. + /// The inner payload is an object. + /// public event Func? AutoModerationRuleUpdate; + + /// + /// Sent when a rule is deleted. + /// The inner payload is an object. + /// public event Func? AutoModerationRuleDelete; + + /// + /// Sent when a rule is triggered and an action is executed (e.g. when a message is blocked). + /// public event Func? AutoModerationActionExecution; + + /// + /// Sent when a new guild channel is created, relevant to the bot. + /// The inner payload is an object. + /// public event Func? GuildChannelCreate; + + /// + /// Sent when a channel is updated. This is not sent with new messages, those are tracked by and . This event may reference roles or guild members that no longer exist in the guild. + /// The inner payload is an object. + /// public event Func? GuildChannelUpdate; + + /// + /// Sent when a channel relevant to the bot is deleted. + /// The inner payload is an object. + /// public event Func? GuildChannelDelete; - public event Func? ChannelPinsUpdate; + + /// + /// Sent when a thread is created, relevant to the bot, or when the current user is added to a thread. + /// The inner payload is an object. + /// public event Func? GuildThreadCreate; + + /// + /// Sent when a thread is updated. This is not sent with new messages, those are tracked by . + /// The inner payload is an object. + /// public event Func? GuildThreadUpdate; + + /// + /// Sent when a thread relevant to the bot is deleted. + /// The inner payload is a subset of an object. + /// public event Func? GuildThreadDelete; + + /// + /// Sent when the current user gains access to a channel. + /// public event Func? GuildThreadListSync; + + /// + /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. + /// The inner payload is a object with a set . + /// public event Func? GuildThreadUserUpdate; + + /// + /// Sent when anyone is added to or removed from a thread. If the bot does not have the intent, then this event will only be sent if it was added or removed from a thread. + /// public event Func? GuildThreadUsersUpdate; + + /// + /// Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted. + /// + public event Func? ChannelPinsUpdate; + + /// + /// Sent when an entitlement is created. + /// The inner payload is an object. + /// + public event Func? EntitlementCreate; + + /// + /// Sent when an entitlement is updated. When an entitlement for a subscription is renewed, the field may have an updated value with the new expiration date. + /// The inner payload is an object. + /// + public event Func? EntitlementUpdate; + + /// + /// Sent when an entitlement is deleted. Entitlements are not deleted when they expire. + /// The inner payload is an object. + /// + public event Func? EntitlementDelete; + + /// + /// This event can be sent in three different scenarios (During an outage, the object in scenarios 1 and 3 may be marked as unavailable):
+ /// • To lazily load and backfill information for all unavailable guilds sent in the event. Guilds unavailable due to an outage will send a event.
+ /// • When a guild becomes available again to the client.
+ /// • When the current user joins a new guild.
+ /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the Intent, or if the guild has over 75k members, members and presences returned in this event will only contain your bot and users in voice channels. + ///
public event Func? GuildCreate; + + /// + /// Sent when a guild is updated. + /// The inner payload is a object. + /// public event Func? GuildUpdate; + + /// + /// Sent when a guild becomes or was already unavailable due to an outage, or when the bot leaves / is removed from a guild. + /// The inner payload is an unavailable guild object. If the field is not true, the bot was removed from the guild. + /// public event Func? GuildDelete; + + /// + /// Sent when a guild audit log entry is created. + /// The inner payload is an object. This event is only sent to bots with the permission. + /// public event Func? GuildAuditLogEntryCreate; + + /// + /// Sent when a user is banned from a guild. + /// public event Func? GuildBanAdd; + + /// + /// Sent when a user is unbanned from a guild. + /// public event Func? GuildBanRemove; + + /// + /// Sent when a guild's emojis have been updated. + /// public event Func? GuildEmojisUpdate; + + /// + /// Sent when a guild's stickers have been updated. + /// public event Func? GuildStickersUpdate; + + /// + /// Sent when a guild integration is updated. + /// public event Func? GuildIntegrationsUpdate; + + /// + /// Sent when a new user joins a guild. Requires the intent. + /// The inner payload is a object with an extra guild_id key. + /// public event Func? GuildUserAdd; - public event Func? GuildUserUpdate; + + /// + /// Sent when a user is removed from a guild (leave/kick/ban). Requires the intent. + /// public event Func? GuildUserRemove; + + /// + /// Sent when a guild member is updated. This will also fire when the object of a guild member changes. Requires the intent. + /// + public event Func? GuildUserUpdate; + + /// + /// Sent in response to . You can use the and to calculate how many chunks are left for your request. + /// public event Func? GuildUserChunk; + + /// + /// Sent when a guild role is created. + /// public event Func? RoleCreate; + + /// + /// Sent when a guild role is updated. + /// public event Func? RoleUpdate; + + /// + /// Sent when a guild role is deleted. + /// public event Func? RoleDelete; + + /// + /// Sent when a guild scheduled event is created. + /// The inner payload is a object. + /// public event Func? GuildScheduledEventCreate; + + /// + /// Sent when a guild scheduled event is updated. + /// The inner payload is a object. + /// public event Func? GuildScheduledEventUpdate; + + /// + /// Sent when a guild scheduled event is deleted. + /// The inner payload is a object. + /// public event Func? GuildScheduledEventDelete; + + /// + /// Sent when a user has subscribed to a guild scheduled event. + /// public event Func? GuildScheduledEventUserAdd; + + /// + /// Sent when a user has unsubscribed from a guild scheduled event. + /// public event Func? GuildScheduledEventUserRemove; + + /// + /// Sent when an integration is created. + /// The inner payload is an integration object with a set . + /// public event Func? GuildIntegrationCreate; + + /// + /// Sent when an integration is updated. + /// The inner payload is an integration object with a set . + /// public event Func? GuildIntegrationUpdate; + + /// + /// Sent when an integration is deleted. + /// public event Func? GuildIntegrationDelete; + + /// + /// Sent when a new invite to a channel is created. Only sent if the bot has the permission for the relevant channel. + /// public event Func? GuildInviteCreate; + + /// + /// Sent when an invite is deleted. Only sent if the bot has the permission for the relevant channel. + /// public event Func? GuildInviteDelete; + + /// + /// Sent when a message is created. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. + /// The inner payload is a message object with set , member and mentions fields. + /// public event Func? MessageCreate; + + /// + /// Sent when a message is updated. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. + /// The inner payload is a message object with the same extra fields as . Updates may contain only a partial object (but will always contain an ID and channel_id). + /// public event Func? MessageUpdate; + + /// + /// Sent when a message is deleted. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. + /// public event Func? MessageDelete; + + /// + /// Sent when multiple messages are deleted at once. + /// public event Func? MessageDeleteBulk; + + /// + /// Sent when a user adds a reaction to a message. + /// public event Func? MessageReactionAdd; + + /// + /// Sent when a user removes a reaction from a message. + /// public event Func? MessageReactionRemove; + + /// + /// Sent when a user explicitly removes all reactions from a message. + /// public event Func? MessageReactionRemoveAll; + + /// + /// Sent when a bot removes all instances of a given emoji from the reactions of a message. + /// public event Func? MessageReactionRemoveEmoji; + + /// + /// Sent when a user's presence or info, such as their name or avatar, is updated. Requires the intent. + /// The user object within this event can be partial, with the id being the only required field, everything else is optional. Along with this limitation, no fields are required, and the types of the fields are not validated. You should expect any combination of fields and types within this event. + /// public event Func? PresenceUpdate; + + /// + /// Sent when a user starts typing in a channel. + /// public event Func? TypingStart; + + /// + /// Sent when properties about the current bot's user change. + /// Inner payload is a object. + /// public event Func? CurrentUserUpdate; + + /// + /// Sent when someone joins/leaves/moves voice channels. + /// Inner payload is a object. + /// public event Func? VoiceStateUpdate; + + /// + /// Sent when a guild's voice server is updated. This is sent when initially connecting to voice, and when the current voice instance fails over to a new server. + /// public event Func? VoiceServerUpdate; + + /// + /// Sent when a guild channel's webhook is created, updated, or deleted. + /// public event Func? WebhooksUpdate; + + /// + /// Sent when a user uses an Application Command or Message Component. + /// Inner payload is an . + /// public event Func? InteractionCreate; + + /// + /// Sent when a is created (i.e. the Stage is now "live"). + /// Inner payload is a . + /// public event Func? StageInstanceCreate; + + /// + /// Sent when a is updated. + /// Inner payload is a . + /// public event Func? StageInstanceUpdate; + + /// + /// Sent when a is deleted (i.e. the Stage has been closed). + /// Inner payload is a . + /// public event Func? StageInstanceDelete; - public event Func? EntitlementCreate; - public event Func? EntitlementUpdate; - public event Func? EntitlementDelete; + + /// + /// Not documented by discord. + /// public event Func? GuildJoinRequestUpdate; + + /// + /// Not documented by discord. + /// public event Func? GuildJoinRequestDelete; + + /// + /// An unknown event. + /// public event Func? UnknownEvent; /// @@ -123,6 +423,9 @@ public partial class GatewayClient : WebSocketClient, IEntity public DateTimeOffset CreatedAt => Token.CreatedAt; + /// + /// Constructs a using the given and . + /// public GatewayClient(IEntityToken token, GatewayClientConfiguration? configuration = null) : this(token, new(token, (configuration ??= new()).RestClientConfiguration), configuration) { _disposeRest = true; @@ -254,8 +557,6 @@ private protected override async Task ProcessPayloadAsync(JsonPayload payload) /// /// Joins, moves, or disconnects the app from a voice channel. /// - /// - /// public ValueTask UpdateVoiceStateAsync(VoiceStateProperties voiceState) { GatewayPayloadProperties payload = new(GatewayOpcode.VoiceStateUpdate, voiceState); @@ -266,7 +567,6 @@ public ValueTask UpdateVoiceStateAsync(VoiceStateProperties voiceState) /// Updates an app's presence. /// /// The presence to set. - /// public ValueTask UpdatePresenceAsync(PresenceProperties presence) { GatewayPayloadProperties payload = new(GatewayOpcode.PresenceUpdate, presence); @@ -276,8 +576,6 @@ public ValueTask UpdatePresenceAsync(PresenceProperties presence) /// /// Requests user for a guild. /// - /// - /// public ValueTask RequestGuildUsersAsync(GuildUsersRequestProperties requestProperties) { GatewayPayloadProperties payload = new(GatewayOpcode.RequestGuildUsers, requestProperties); From cf45b5355e8eab0887173e26a543c0df70a39ced Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:00:17 +0200 Subject: [PATCH 05/36] Opcode Documentation Added --- NetCord/Gateway/GatewayOpcode.cs | 45 +++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayOpcode.cs b/NetCord/Gateway/GatewayOpcode.cs index 47d0cd87..13c29ac0 100644 --- a/NetCord/Gateway/GatewayOpcode.cs +++ b/NetCord/Gateway/GatewayOpcode.cs @@ -2,15 +2,58 @@ internal enum GatewayOpcode : byte { + /// + /// An event was dispatched. + /// Dispatch = 0, + + /// + /// Fired periodically by the client to keep the connection alive. + /// Heartbeat = 1, + + /// + /// Starts a new session during the initial handshake. + /// Identify = 2, + + /// + /// Update the client's presence. + /// PresenceUpdate = 3, + + /// + /// Used to join/leave or move between voice channels. + /// VoiceStateUpdate = 4, + + /// + /// Resume a previous session that was disconnected. + /// Resume = 6, + + /// + /// You should attempt to reconnect and resume immediately. + /// Reconnect = 7, + + /// + /// Request information about offline guild members in a large guild. + /// RequestGuildUsers = 8, + + /// + /// The session has been invalidated. You should reconnect and identify/resume accordingly. + /// InvalidSession = 9, + + /// + /// Sent immediately after connecting, contains the heartbeat_interval to use. + /// Hello = 10, + + /// + /// Sent in response to receiving a heartbeat to acknowledge that it has been received. + /// HeartbeatACK = 11, -} +} \ No newline at end of file From 5c27a36cbfe0bf2463955379716dab3593a934c5 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:16:51 +0200 Subject: [PATCH 06/36] Fixed errors in references to GuildThreadUser. --- NetCord/Gateway/GatewayClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 2796cee1..21268a76 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -94,8 +94,8 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? GuildThreadListSync; /// - /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. - /// The inner payload is a object with a set . + /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. + /// The inner payload is a object with a set . /// public event Func? GuildThreadUserUpdate; From 05031d3a752fb1a13b020d123ba7c6b8924fb895 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:37:45 +0200 Subject: [PATCH 07/36] Rewrote bullet points into XML. --- NetCord/Gateway/GatewayClient.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 21268a76..f3d125d5 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -1,4 +1,4 @@ -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using System.Text.Json; using NetCord.Gateway.Compression; @@ -129,9 +129,23 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// This event can be sent in three different scenarios (During an outage, the object in scenarios 1 and 3 may be marked as unavailable):
- /// • To lazily load and backfill information for all unavailable guilds sent in the event. Guilds unavailable due to an outage will send a event.
- /// • When a guild becomes available again to the client.
- /// • When the current user joins a new guild.
+ /// + /// + /// + /// To lazily load and backfill information for all unavailable guilds sent in the event. Guilds unavailable due to an outage will send a event. + /// + /// + /// + /// + /// When a guild becomes available again to the client. + /// + /// + /// + /// + /// When the current user joins a new guild. + /// + /// + /// /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the Intent, or if the guild has over 75k members, members and presences returned in this event will only contain your bot and users in voice channels. ///
public event Func? GuildCreate; From ea2048c453fe6236727376706729de9da13ff6a6 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 13:42:37 +0200 Subject: [PATCH 08/36] Rewrote GatewayIntents bullet points into XML tags. --- NetCord/Gateway/GatewayIntents.cs | 40 +++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/NetCord/Gateway/GatewayIntents.cs b/NetCord/Gateway/GatewayIntents.cs index f8adb185..bcb6951e 100644 --- a/NetCord/Gateway/GatewayIntents.cs +++ b/NetCord/Gateway/GatewayIntents.cs @@ -7,13 +7,39 @@ namespace NetCord.Gateway; public enum GatewayIntents : uint { /// - /// Associated with the following events:
- /// • Guild Events: , ,
- /// • Role Events: , ,
- /// • Channel Events: , , ,
- /// • Thread Events: , , ,
- /// • Thread User Events: ,
- /// • Stage Events: , , + /// Associated with the following events: + /// + /// + /// + /// Guild Events: , ,
+ ///
+ ///
+ /// + /// + /// Role Events: , ,
+ ///
+ ///
+ /// + /// + /// Channel Events: , , ,
+ ///
+ ///
+ /// + /// + /// Thread Events: , , ,
+ ///
+ ///
+ /// + /// + /// Thread User Events: ,
+ ///
+ ///
+ /// + /// + /// Stage Events: , , + /// + /// + ///
///
Guilds = 1 << 0, From c5d3425f842ce266ad5ece40624e4f4a531cf38e Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:00:49 +0200 Subject: [PATCH 09/36] Added a summary comment for the GatewayClient type. --- NetCord/Gateway/GatewayClient.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index f3d125d5..3800eeb5 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -8,6 +8,9 @@ namespace NetCord.Gateway; +/// +/// The GatewayClient allows the bot to communicate with discord's servers, allowing it to recieve events, opcodes, etc. +/// public partial class GatewayClient : WebSocketClient, IEntity { private readonly GatewayClientConfiguration _configuration; From e0b8ea5b5576190626ae7a45c48e96208354ba9d Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 24 Apr 2024 14:02:35 +0200 Subject: [PATCH 10/36] Added a summary comment for the GatewayOpcode type. --- NetCord/Gateway/GatewayOpcode.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayOpcode.cs b/NetCord/Gateway/GatewayOpcode.cs index 13c29ac0..6d4d9d42 100644 --- a/NetCord/Gateway/GatewayOpcode.cs +++ b/NetCord/Gateway/GatewayOpcode.cs @@ -1,5 +1,8 @@ namespace NetCord.Gateway; +/// +/// Contains all valid opcodes sent/received by the client. +/// internal enum GatewayOpcode : byte { /// @@ -56,4 +59,4 @@ internal enum GatewayOpcode : byte /// Sent in response to receiving a heartbeat to acknowledge that it has been received. /// HeartbeatACK = 11, -} \ No newline at end of file +} From 6b37a500da8e91ad84676ed46562ba8ee97b3d4a Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:35:50 +0300 Subject: [PATCH 11/36] Spelling fix for associated. Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Gateway/GatewayIntents.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayIntents.cs b/NetCord/Gateway/GatewayIntents.cs index bcb6951e..20fd19bb 100644 --- a/NetCord/Gateway/GatewayIntents.cs +++ b/NetCord/Gateway/GatewayIntents.cs @@ -86,7 +86,7 @@ public enum GatewayIntents : uint GuildVoiceStates = 1 << 7, /// - /// Privileged, ssociated with the following events:
+ /// Privileged, associated with the following events:
/// ///
GuildPresences = 1 << 8, From 2fdfeb3e378acfdccb864a493b5d65a1c20b7abc Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:37:04 +0300 Subject: [PATCH 12/36] Clarification for Interaction vs Application Command / Message Component Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 3800eeb5..21d11a04 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -363,7 +363,7 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? WebhooksUpdate; /// - /// Sent when a user uses an Application Command or Message Component. + /// Sent when a user uses an interaction. /// Inner payload is an . /// public event Func? InteractionCreate; From 9e12fcccd38886bcd5b7eb953b45cfaa230b0cbf Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:47:04 +0300 Subject: [PATCH 13/36] 10 second clarification for TypingStart --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 21d11a04..6a867c35 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -336,7 +336,7 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? PresenceUpdate; /// - /// Sent when a user starts typing in a channel. + /// Sent when a user starts typing in a channel, and fires again every 10 seconds while they continue typing. /// public event Func? TypingStart; From 3154c1b0a64e173491408997bdd64170ccd7e0f0 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:49:06 +0300 Subject: [PATCH 14/36] Plural clarification for GuildIntegrationsUpdate --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 6a867c35..c1601e9d 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -192,7 +192,7 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? GuildStickersUpdate; /// - /// Sent when a guild integration is updated. + /// Sent when guild integrations are updated. /// public event Func? GuildIntegrationsUpdate; From 1843ce4f23ad33ea9a83220ef43161804210ceb1 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 02:03:02 +0300 Subject: [PATCH 15/36] Corrected bot to user in MessageReactionRemoveEmoji --- NetCord/Gateway/GatewayClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index c1601e9d..afa587b4 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -98,7 +98,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. - /// The inner payload is a object with a set . + /// The inner payload is a object with a set . /// public event Func? GuildThreadUserUpdate; @@ -325,7 +325,7 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? MessageReactionRemoveAll; /// - /// Sent when a bot removes all instances of a given emoji from the reactions of a message. + /// Sent when a user removes all instances of a given emoji from the reactions of a message. /// public event Func? MessageReactionRemoveEmoji; From b8d2f7501e0e07387c5f0fcf40f20123d5cc9d14 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 02:05:53 +0300 Subject: [PATCH 16/36] Minor error fix. --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index afa587b4..329e5774 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -98,7 +98,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. - /// The inner payload is a object with a set . + /// The inner payload is a object with a set . /// public event Func? GuildThreadUserUpdate; From 99f3d2161150fefee7829bed8ed83a08b0b07749 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 02:47:48 +0300 Subject: [PATCH 17/36] GatewayClient description updated. --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 329e5774..289ad353 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -9,7 +9,7 @@ namespace NetCord.Gateway; /// -/// The GatewayClient allows the bot to communicate with discord's servers, allowing it to recieve events, opcodes, etc. +/// The is the core component for allowing the bot to communicate with discord's servers. /// public partial class GatewayClient : WebSocketClient, IEntity { From 4c02f97e1b20f8257d6ff1288adcb20d6ff4f2d1 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 02:51:13 +0300 Subject: [PATCH 18/36] Changed instances of member to user in GatewayClient.cs --- NetCord/Gateway/GatewayClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 289ad353..1843743d 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -149,7 +149,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// /// - /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the Intent, or if the guild has over 75k members, members and presences returned in this event will only contain your bot and users in voice channels. + /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the Intent, or if the guild has over 75k users, users and presences returned in this event will only contain your bot and users in voice channels. ///
public event Func? GuildCreate; @@ -208,7 +208,7 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? GuildUserRemove; /// - /// Sent when a guild member is updated. This will also fire when the object of a guild member changes. Requires the intent. + /// Sent when a guild user is updated. This will also fire when the object of a guild user changes. Requires the intent. /// public event Func? GuildUserUpdate; From b7747fa5b03dc01e71f856ce7787de955d03d9f2 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:11:40 +0300 Subject: [PATCH 19/36] Changed Intent to intent --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 1843743d..0d506035 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -149,7 +149,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// /// - /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the Intent, or if the guild has over 75k users, users and presences returned in this event will only contain your bot and users in voice channels. + /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the intent, or if the guild has over 75k users, users and presences returned in this event will only contain your bot and users in voice channels. /// public event Func? GuildCreate; From 706cf8bbdff26319b2197f81bea1205fdf004c8d Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:40:01 +0300 Subject: [PATCH 20/36] Modified reference from `member` to `RestMessage.Author` --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 0d506035..2747ae7b 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -289,7 +289,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is created. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. - /// The inner payload is a message object with set , member and mentions fields. + /// The inner payload is a message object with set , and fields. /// public event Func? MessageCreate; From 4ba229588344b95f5262a6da14ed65e691b418e4 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:47:29 +0300 Subject: [PATCH 21/36] Error fix --- NetCord/Gateway/GatewayClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 2747ae7b..c199969a 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -289,13 +289,13 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is created. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. - /// The inner payload is a message object with set , and fields. + /// The inner payload is a message object with set , and fields. /// public event Func? MessageCreate; /// /// Sent when a message is updated. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. - /// The inner payload is a message object with the same extra fields as . Updates may contain only a partial object (but will always contain an ID and channel_id). + /// The inner payload is a message object with the same set fields as . Updates may contain only a partial object, in which case they are not handled by NetCord. /// public event Func? MessageUpdate; From 45e05322de3207cb895f52a152fe8886e8ce6148 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:52:22 +0300 Subject: [PATCH 22/36] Basic required and optional intents laid out from documentation. --- NetCord/Gateway/GatewayClient.cs | 295 ++++++++++++++++++++++++------- 1 file changed, 228 insertions(+), 67 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index c199969a..9c9024c6 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -22,111 +22,169 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions). - /// The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform. + /// The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? Ready; /// /// Sent when an application command's permissions are updated. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? ApplicationCommandPermissionsUpdate; /// /// Sent when a rule is created. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? AutoModerationRuleCreate; /// /// Sent when a rule is updated. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? AutoModerationRuleUpdate; /// /// Sent when a rule is deleted. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? AutoModerationRuleDelete; /// - /// Sent when a rule is triggered and an action is executed (e.g. when a message is blocked). + /// Sent when a rule is triggered and an action is executed (e.g. when a message is blocked).
+ ///
Required Intents: None + ///
Optional Intents: + /// + /// + /// + /// + /// + /// + /// For receiving and . + /// + /// + /// ///
public event Func? AutoModerationActionExecution; /// /// Sent when a new guild channel is created, relevant to the bot. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildChannelCreate; /// /// Sent when a channel is updated. This is not sent with new messages, those are tracked by and . This event may reference roles or guild members that no longer exist in the guild. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildChannelUpdate; /// /// Sent when a channel relevant to the bot is deleted. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildChannelDelete; /// /// Sent when a thread is created, relevant to the bot, or when the current user is added to a thread. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildThreadCreate; /// /// Sent when a thread is updated. This is not sent with new messages, those are tracked by . - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildThreadUpdate; /// /// Sent when a thread relevant to the bot is deleted. - /// The inner payload is a subset of an object. + /// The inner payload is a subset of an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildThreadDelete; /// - /// Sent when the current user gains access to a channel. + /// Sent when the current user gains access to a channel.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildThreadListSync; /// /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. - /// The inner payload is a object with a set . + /// The inner payload is a object with a set .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildThreadUserUpdate; /// - /// Sent when anyone is added to or removed from a thread. If the bot does not have the intent, then this event will only be sent if it was added or removed from a thread. + /// Sent when anyone is added to or removed from a thread.
+ ///
Required Intents: None + ///
Optional Intents: + /// + /// + /// + /// + /// + /// + /// For receiving this event when other users are added / removed, otherwise this event will only fire for the bot's user. + /// + /// + /// ///
public event Func? GuildThreadUsersUpdate; /// - /// Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted. + /// Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? ChannelPinsUpdate; /// /// Sent when an entitlement is created. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? EntitlementCreate; /// /// Sent when an entitlement is updated. When an entitlement for a subscription is renewed, the field may have an updated value with the new expiration date. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? EntitlementUpdate; /// /// Sent when an entitlement is deleted. Entitlements are not deleted when they expire. - /// The inner payload is an object. + /// The inner payload is an object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? EntitlementDelete; @@ -149,240 +207,342 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// /// - /// The inner payload can be a object with extra fields, or an unavailable object. If your bot does not have the intent, or if the guild has over 75k users, users and presences returned in this event will only contain your bot and users in voice channels. + /// The inner payload can be a object with extra fields, or an unavailable object. If the guild has over 75k users, users and presences returned in this event will only contain your bot and users in voice channels.
+ ///
Required Intents: None + ///
Optional Intents: + /// + /// + /// + /// + /// + /// + /// For receiving users and presences other than the bot's user and users in voice channels (Same as the 75k limit). + /// + /// + /// /// public event Func? GuildCreate; /// /// Sent when a guild is updated. - /// The inner payload is a object. + /// The inner payload is a object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildUpdate; /// /// Sent when a guild becomes or was already unavailable due to an outage, or when the bot leaves / is removed from a guild. - /// The inner payload is an unavailable guild object. If the field is not true, the bot was removed from the guild. + /// The inner payload is an unavailable guild object. If the field is not true, the bot was removed from the guild.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildDelete; /// /// Sent when a guild audit log entry is created. - /// The inner payload is an object. This event is only sent to bots with the permission. + /// The inner payload is an object. This event is only sent to bots with the permission.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildAuditLogEntryCreate; /// - /// Sent when a user is banned from a guild. + /// Sent when a user is banned from a guild.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildBanAdd; /// - /// Sent when a user is unbanned from a guild. + /// Sent when a user is unbanned from a guild.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildBanRemove; /// - /// Sent when a guild's emojis have been updated. + /// Sent when a guild's emojis have been updated.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildEmojisUpdate; /// - /// Sent when a guild's stickers have been updated. + /// Sent when a guild's stickers have been updated.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildStickersUpdate; /// - /// Sent when guild integrations are updated. + /// Sent when guild integrations are updated.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildIntegrationsUpdate; /// - /// Sent when a new user joins a guild. Requires the intent. - /// The inner payload is a object with an extra guild_id key. + /// Sent when a new user joins a guild. + /// The inner payload is a object with an extra guild_id key.
+ ///
Required Intents: + ///
Optional Intents: None ///
public event Func? GuildUserAdd; /// - /// Sent when a user is removed from a guild (leave/kick/ban). Requires the intent. + /// Sent when a user is removed from a guild (leave/kick/ban).
+ ///
Required Intents: + ///
Optional Intents: None ///
public event Func? GuildUserRemove; /// - /// Sent when a guild user is updated. This will also fire when the object of a guild user changes. Requires the intent. + /// Sent when a guild user is updated. This will also fire when the object of a guild user changes.
+ ///
Required Intents: + ///
Optional Intents: None ///
public event Func? GuildUserUpdate; /// - /// Sent in response to . You can use the and to calculate how many chunks are left for your request. + /// Sent in response to . You can use the and to calculate how many chunks are left for your request.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildUserChunk; /// - /// Sent when a guild role is created. + /// Sent when a guild role is created.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? RoleCreate; /// - /// Sent when a guild role is updated. + /// Sent when a guild role is updated.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? RoleUpdate; /// - /// Sent when a guild role is deleted. + /// Sent when a guild role is deleted.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? RoleDelete; /// /// Sent when a guild scheduled event is created. - /// The inner payload is a object. + /// The inner payload is a object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildScheduledEventCreate; /// /// Sent when a guild scheduled event is updated. - /// The inner payload is a object. + /// The inner payload is a object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildScheduledEventUpdate; /// /// Sent when a guild scheduled event is deleted. - /// The inner payload is a object. + /// The inner payload is a object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildScheduledEventDelete; /// - /// Sent when a user has subscribed to a guild scheduled event. + /// Sent when a user has subscribed to a guild scheduled event.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildScheduledEventUserAdd; /// - /// Sent when a user has unsubscribed from a guild scheduled event. + /// Sent when a user has unsubscribed from a guild scheduled event.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildScheduledEventUserRemove; /// /// Sent when an integration is created. - /// The inner payload is an integration object with a set . + /// The inner payload is an integration object with a set .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildIntegrationCreate; /// /// Sent when an integration is updated. - /// The inner payload is an integration object with a set . + /// The inner payload is an integration object with a set .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildIntegrationUpdate; /// - /// Sent when an integration is deleted. + /// Sent when an integration is deleted.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildIntegrationDelete; /// - /// Sent when a new invite to a channel is created. Only sent if the bot has the permission for the relevant channel. + /// Sent when a new invite to a channel is created. Only sent if the bot has the permission for the relevant channel.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildInviteCreate; /// - /// Sent when an invite is deleted. Only sent if the bot has the permission for the relevant channel. + /// Sent when an invite is deleted. Only sent if the bot has the permission for the relevant channel.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? GuildInviteDelete; /// - /// Sent when a message is created. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. - /// The inner payload is a message object with set , and fields. + /// Sent when a message is created. + /// The inner payload is a message object with set , and fields.
+ ///
Required Intents: * + ///
Optional Intents: None + ///

+ /// *Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or . ///
public event Func? MessageCreate; /// - /// Sent when a message is updated. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. - /// The inner payload is a message object with the same set fields as . Updates may contain only a partial object, in which case they are not handled by NetCord. + /// Sent when a message is updated. + /// The inner payload is a message object with the same set fields as . Updates may contain only a partial object, in which case they are not handled by NetCord.
+ ///
Required Intents: * + ///
Optional Intents: None + ///

+ /// *Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or . ///
public event Func? MessageUpdate; /// - /// Sent when a message is deleted. Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or member. + /// Sent when a message is deleted.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? MessageDelete; /// - /// Sent when multiple messages are deleted at once. + /// Sent when multiple messages are deleted at once.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? MessageDeleteBulk; /// - /// Sent when a user adds a reaction to a message. + /// Sent when a user adds a reaction to a message.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? MessageReactionAdd; /// - /// Sent when a user removes a reaction from a message. + /// Sent when a user removes a reaction from a message.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? MessageReactionRemove; /// - /// Sent when a user explicitly removes all reactions from a message. + /// Sent when a user explicitly removes all reactions from a message.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? MessageReactionRemoveAll; /// - /// Sent when a user removes all instances of a given emoji from the reactions of a message. + /// Sent when a user removes all instances of a given emoji from the reactions of a message.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? MessageReactionRemoveEmoji; /// /// Sent when a user's presence or info, such as their name or avatar, is updated. Requires the intent. - /// The user object within this event can be partial, with the id being the only required field, everything else is optional. Along with this limitation, no fields are required, and the types of the fields are not validated. You should expect any combination of fields and types within this event. + /// The user object within this event can be partial, with the id being the only required field, everything else is optional. Along with this limitation, no fields are required, and the types of the fields are not validated. You should expect any combination of fields and types within this event.
+ ///
Required Intents: + ///
Optional Intents: None ///
public event Func? PresenceUpdate; /// - /// Sent when a user starts typing in a channel, and fires again every 10 seconds while they continue typing. + /// Sent when a user starts typing in a channel, and fires again every 10 seconds while they continue typing.
+ ///
Required Intents: + ///
Optional Intents: None ///
public event Func? TypingStart; /// /// Sent when properties about the current bot's user change. - /// Inner payload is a object. + /// Inner payload is a object.
+ ///
Required Intents: + ///
Optional Intents: None ///
public event Func? CurrentUserUpdate; /// /// Sent when someone joins/leaves/moves voice channels. - /// Inner payload is a object. + /// Inner payload is a object.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? VoiceStateUpdate; /// - /// Sent when a guild's voice server is updated. This is sent when initially connecting to voice, and when the current voice instance fails over to a new server. + /// Sent when a guild's voice server is updated. This is sent when initially connecting to voice, and when the current voice instance fails over to a new server.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? VoiceServerUpdate; /// - /// Sent when a guild channel's webhook is created, updated, or deleted. + /// Sent when a guild channel's webhook is created, updated, or deleted.
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? WebhooksUpdate; /// /// Sent when a user uses an interaction. - /// Inner payload is an . + /// Inner payload is an .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? InteractionCreate; /// - /// Sent when a is created (i.e. the Stage is now "live"). - /// Inner payload is a . + /// Sent when a is created (i.e. the Stage is now 'live'). + /// Inner payload is a .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? StageInstanceCreate; /// /// Sent when a is updated. - /// Inner payload is a . + /// Inner payload is a .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? StageInstanceUpdate; /// /// Sent when a is deleted (i.e. the Stage has been closed). - /// Inner payload is a . + /// Inner payload is a .
+ ///
Required Intents: None + ///
Optional Intents: None ///
public event Func? StageInstanceDelete; @@ -401,6 +561,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// public event Func? UnknownEvent; + /// /// The token of the . /// From 2fc1b5a7aa47e083983ac8036ec74fbb95f6c284 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:34:55 +0300 Subject: [PATCH 23/36] Added more required intents to docs. --- NetCord/Gateway/GatewayClient.cs | 176 +++++++++++++++++++++---------- 1 file changed, 122 insertions(+), 54 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 9c9024c6..a07c9d6c 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -39,7 +39,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a rule is created. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? AutoModerationRuleCreate; @@ -47,7 +47,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a rule is updated. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? AutoModerationRuleUpdate; @@ -55,14 +55,14 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a rule is deleted. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? AutoModerationRuleDelete; /// /// Sent when a rule is triggered and an action is executed (e.g. when a message is blocked).
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: /// /// @@ -80,7 +80,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a new guild channel is created, relevant to the bot. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildChannelCreate; @@ -88,7 +88,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a channel is updated. This is not sent with new messages, those are tracked by and . This event may reference roles or guild members that no longer exist in the guild. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildChannelUpdate; @@ -96,7 +96,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a channel relevant to the bot is deleted. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildChannelDelete; @@ -104,7 +104,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a thread is created, relevant to the bot, or when the current user is added to a thread. /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildThreadCreate; @@ -112,7 +112,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a thread is updated. This is not sent with new messages, those are tracked by . /// The inner payload is an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildThreadUpdate; @@ -120,14 +120,14 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a thread relevant to the bot is deleted. /// The inner payload is a subset of an object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildThreadDelete; /// /// Sent when the current user gains access to a channel.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildThreadListSync; @@ -135,14 +135,14 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when the object for the bot is updated. This event is largely just a signal that you are a member of the thread. /// The inner payload is a object with a set .
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildThreadUserUpdate; /// /// Sent when anyone is added to or removed from a thread.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: /// /// @@ -159,7 +159,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is pinned or unpinned in a text channel. This is not sent when a pinned message is deleted.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? ChannelPinsUpdate; @@ -208,7 +208,7 @@ public partial class GatewayClient : WebSocketClient, IEntity ///
///
/// The inner payload can be a object with extra fields, or an unavailable object. If the guild has over 75k users, users and presences returned in this event will only contain your bot and users in voice channels.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: /// /// @@ -226,7 +226,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild is updated. /// The inner payload is a object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildUpdate; @@ -234,7 +234,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild becomes or was already unavailable due to an outage, or when the bot leaves / is removed from a guild. /// The inner payload is an unavailable guild object. If the field is not true, the bot was removed from the guild.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildDelete; @@ -242,42 +242,42 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild audit log entry is created. /// The inner payload is an object. This event is only sent to bots with the permission.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildAuditLogEntryCreate; /// /// Sent when a user is banned from a guild.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildBanAdd; /// /// Sent when a user is unbanned from a guild.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildBanRemove; /// /// Sent when a guild's emojis have been updated.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildEmojisUpdate; /// /// Sent when a guild's stickers have been updated.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildStickersUpdate; /// /// Sent when guild integrations are updated.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildIntegrationsUpdate; @@ -313,21 +313,21 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild role is created.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? RoleCreate; /// /// Sent when a guild role is updated.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? RoleUpdate; /// /// Sent when a guild role is deleted.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? RoleDelete; @@ -335,7 +335,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild scheduled event is created. /// The inner payload is a object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildScheduledEventCreate; @@ -343,7 +343,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild scheduled event is updated. /// The inner payload is a object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildScheduledEventUpdate; @@ -351,21 +351,21 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild scheduled event is deleted. /// The inner payload is a object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildScheduledEventDelete; /// /// Sent when a user has subscribed to a guild scheduled event.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildScheduledEventUserAdd; /// /// Sent when a user has unsubscribed from a guild scheduled event.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildScheduledEventUserRemove; @@ -373,7 +373,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when an integration is created. /// The inner payload is an integration object with a set .
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildIntegrationCreate; @@ -381,28 +381,28 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when an integration is updated. /// The inner payload is an integration object with a set .
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildIntegrationUpdate; /// /// Sent when an integration is deleted.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildIntegrationDelete; /// /// Sent when a new invite to a channel is created. Only sent if the bot has the permission for the relevant channel.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildInviteCreate; /// /// Sent when an invite is deleted. Only sent if the bot has the permission for the relevant channel.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? GuildInviteDelete; @@ -410,8 +410,41 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is created. /// The inner payload is a message object with set , and fields.
- ///
Required Intents: * - ///
Optional Intents: None + ///
Required Intents: , * + ///
Optional Intents: + /// + /// + /// + /// + /// + /// + /// For receiving , , and .
+ /// This does not apply to: + /// + /// + /// + /// Content in messages sent by the bot. + /// + /// + /// + /// + /// Content in DMs with the bot. + /// + /// + /// + /// + /// Content in which the bot is mentioned. + /// + /// + /// + /// + /// Content of messages a message context menu command is used on. + /// + /// + /// + ///
+ ///
+ ///
///

/// *Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or . ///
@@ -420,8 +453,41 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is updated. /// The inner payload is a message object with the same set fields as . Updates may contain only a partial object, in which case they are not handled by NetCord.
- ///
Required Intents: * - ///
Optional Intents: None + ///
Required Intents: , * + ///
Optional Intents: + /// + /// + /// + /// + /// + /// + /// For receiving , , and .
+ /// This does not apply to: + /// + /// + /// + /// Content in messages sent by the bot. + /// + /// + /// + /// + /// Content in DMs with the bot. + /// + /// + /// + /// + /// Content in which the bot is mentioned. + /// + /// + /// + /// + /// Content of messages a message context menu command is used on. + /// + /// + /// + ///
+ ///
+ ///
///

/// *Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or . ///
@@ -429,42 +495,42 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is deleted.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? MessageDelete; /// /// Sent when multiple messages are deleted at once.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? MessageDeleteBulk; /// /// Sent when a user adds a reaction to a message.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? MessageReactionAdd; /// /// Sent when a user removes a reaction from a message.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? MessageReactionRemove; /// /// Sent when a user explicitly removes all reactions from a message.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? MessageReactionRemoveAll; /// /// Sent when a user removes all instances of a given emoji from the reactions of a message.
- ///
Required Intents: None + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? MessageReactionRemoveEmoji; @@ -472,14 +538,16 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a user's presence or info, such as their name or avatar, is updated. Requires the intent. /// The user object within this event can be partial, with the id being the only required field, everything else is optional. Along with this limitation, no fields are required, and the types of the fields are not validated. You should expect any combination of fields and types within this event.
- ///
Required Intents: + ///
Required Intents: * ///
Optional Intents: None + ///

+ /// *Must also be enabled in the developer portal. ///
public event Func? PresenceUpdate; /// /// Sent when a user starts typing in a channel, and fires again every 10 seconds while they continue typing.
- ///
Required Intents: + ///
Required Intents: , ///
Optional Intents: None ///
public event Func? TypingStart; @@ -487,7 +555,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when properties about the current bot's user change. /// Inner payload is a object.
- ///
Required Intents: + ///
Required Intents: None ///
Optional Intents: None ///
public event Func? CurrentUserUpdate; @@ -495,7 +563,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when someone joins/leaves/moves voice channels. /// Inner payload is a object.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? VoiceStateUpdate; @@ -509,7 +577,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a guild channel's webhook is created, updated, or deleted.
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? WebhooksUpdate; @@ -525,7 +593,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a is created (i.e. the Stage is now 'live'). /// Inner payload is a .
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? StageInstanceCreate; @@ -533,7 +601,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a is updated. /// Inner payload is a .
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? StageInstanceUpdate; @@ -541,7 +609,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a is deleted (i.e. the Stage has been closed). /// Inner payload is a .
- ///
Required Intents: None + ///
Required Intents: ///
Optional Intents: None ///
public event Func? StageInstanceDelete; From ad3f0c8da15b6869ee38d56c4f43598298d9b2d2 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:37:30 +0300 Subject: [PATCH 24/36] Added GuildUsers note. --- NetCord/Gateway/GatewayClient.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index a07c9d6c..0b653cbe 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -142,7 +142,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when anyone is added to or removed from a thread.
- ///
Required Intents: , + ///
Required Intents: , * ///
Optional Intents: /// /// @@ -154,6 +154,8 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// /// + ///

+ /// *Must also be enabled in the developer portal. ///
public event Func? GuildThreadUsersUpdate; @@ -285,22 +287,28 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a new user joins a guild. /// The inner payload is a object with an extra guild_id key.
- ///
Required Intents: + ///
Required Intents: * ///
Optional Intents: None + ///

+ /// *Must also be enabled in the developer portal. ///
public event Func? GuildUserAdd; /// /// Sent when a user is removed from a guild (leave/kick/ban).
- ///
Required Intents: + ///
Required Intents: * ///
Optional Intents: None + ///

+ /// *Must also be enabled in the developer portal. ///
public event Func? GuildUserRemove; /// /// Sent when a guild user is updated. This will also fire when the object of a guild user changes.
- ///
Required Intents: + ///
Required Intents: * ///
Optional Intents: None + ///

+ /// *Must also be enabled in the developer portal. ///
public event Func? GuildUserUpdate; From f649c39e0bdf8cacea1d9a4a36f3285990340b7c Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 16:39:30 +0300 Subject: [PATCH 25/36] Fixed br tags. --- NetCord/Gateway/GatewayClient.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 0b653cbe..875879e6 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -154,7 +154,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// ///
///
- ///

+ ///

/// *Must also be enabled in the developer portal. ///
public event Func? GuildThreadUsersUpdate; @@ -289,7 +289,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// The inner payload is a object with an extra guild_id key.
///
Required Intents: * ///
Optional Intents: None - ///

+ ///

/// *Must also be enabled in the developer portal. ///
public event Func? GuildUserAdd; @@ -298,7 +298,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// Sent when a user is removed from a guild (leave/kick/ban).
///
Required Intents: * ///
Optional Intents: None - ///

+ ///

/// *Must also be enabled in the developer portal. /// public event Func? GuildUserRemove; @@ -307,7 +307,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// Sent when a guild user is updated. This will also fire when the object of a guild user changes.
///
Required Intents: * ///
Optional Intents: None - ///

+ ///

/// *Must also be enabled in the developer portal. /// public event Func? GuildUserUpdate; From 09c37718ce73756c7c8582818af60450940c322d Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Fri, 26 Apr 2024 19:34:55 +0300 Subject: [PATCH 26/36] Added a very necessary region --- NetCord/Gateway/GatewayClient.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 875879e6..a6b9302b 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -20,6 +20,8 @@ public partial class GatewayClient : WebSocketClient, IEntity private readonly IGatewayCompression _compression; private readonly bool _disposeRest; + #region Events + /// /// The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions). /// The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
@@ -636,7 +638,8 @@ public partial class GatewayClient : WebSocketClient, IEntity /// An unknown event. ///
public event Func? UnknownEvent; - + + #endregion /// /// The token of the . From 03efcf2aac058242bdc7b8d18a68bcf74425dec0 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Mon, 29 Apr 2024 07:01:41 +0300 Subject: [PATCH 27/36] Replace all instances of discord with Discord --- NetCord/Gateway/GatewayClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index a6b9302b..9bc3a037 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -9,7 +9,7 @@ namespace NetCord.Gateway; /// -/// The is the core component for allowing the bot to communicate with discord's servers. +/// The is the core component for allowing the bot to communicate with Discord's servers. /// public partial class GatewayClient : WebSocketClient, IEntity { @@ -625,12 +625,12 @@ public partial class GatewayClient : WebSocketClient, IEntity public event Func? StageInstanceDelete; /// - /// Not documented by discord. + /// Not documented by Discord. /// public event Func? GuildJoinRequestUpdate; /// - /// Not documented by discord. + /// Not documented by Discord. /// public event Func? GuildJoinRequestDelete; From e6ebf379240de385460feeac8defb86540b682f9 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Thu, 9 May 2024 02:05:23 +0300 Subject: [PATCH 28/36] Updated description for the GatewayClient Co-authored-by: Kuba_Z2 <77853483+KubaZ2@users.noreply.github.com> --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 9bc3a037..0eab9b2f 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -9,7 +9,7 @@ namespace NetCord.Gateway; /// -/// The is the core component for allowing the bot to communicate with Discord's servers. +/// The WebSocket-based client allows you to receive events from Discord's Gateway and update or request resources, such as updating voice state. /// public partial class GatewayClient : WebSocketClient, IEntity { From 0da34ddb664036ead31e0afcb5e5b5473e54e1fe Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Thu, 9 May 2024 02:15:41 +0300 Subject: [PATCH 29/36] Merge conflict fix, updated Ready event --- NetCord/Gateway/GatewayClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 0eab9b2f..0977d3f4 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -24,7 +24,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions). - /// The ready event can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
+ /// The ready event, while generally small in practice, can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
///
Required Intents: None ///
Optional Intents: None ///
@@ -326,14 +326,14 @@ public partial class GatewayClient : WebSocketClient, IEntity ///
Required Intents: ///
Optional Intents: None ///
- public event Func? RoleCreate; + public event Func? RoleCreate; /// /// Sent when a guild role is updated.
///
Required Intents: ///
Optional Intents: None ///
- public event Func? RoleUpdate; + public event Func? RoleUpdate; /// /// Sent when a guild role is deleted.
From 8241c92ba8f01587987c002d3afc78e05acdf065 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Thu, 9 May 2024 03:15:12 +0300 Subject: [PATCH 30/36] Updated GatewayClient description, and correct casing for the word 'gateway' in other descriptions. --- NetCord/Gateway/GatewayClient.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 0977d3f4..83507790 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -9,7 +9,7 @@ namespace NetCord.Gateway; /// -/// The WebSocket-based client allows you to receive events from Discord's Gateway and update or request resources, such as updating voice state. +/// The WebSocket-based client allows you to receive events from the Discord Gateway and update or request resources, such as updating voice state. /// public partial class GatewayClient : WebSocketClient, IEntity { @@ -23,8 +23,8 @@ public partial class GatewayClient : WebSocketClient, IEntity #region Events /// - /// The ready event is dispatched when a client has completed the initial handshake with the gateway (for new sessions). - /// The ready event, while generally small in practice, can be the largest and most complex event the gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
+ /// The ready event is dispatched when a client has completed the initial handshake with the Gateway (for new sessions). + /// The ready event, while generally small in practice, can be the largest and most complex event the Gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
///
Required Intents: None ///
Optional Intents: None ///
From 1735cd0460a8e82bd7a02ae407038a816ef181b9 Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Thu, 9 May 2024 21:58:09 +0300 Subject: [PATCH 31/36] Removed size description from ready event. --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 83507790..0a27ccd7 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -24,7 +24,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// The ready event is dispatched when a client has completed the initial handshake with the Gateway (for new sessions). - /// The ready event, while generally small in practice, can be the largest and most complex event the Gateway will send, as it contains all the state required for a client to begin interacting with the rest of the platform.
+ /// The ready event contains all the state required for a client to begin interacting with the rest of the platform.
///
Required Intents: None ///
Optional Intents: None ///
From b0110d2f10f3cd2374b7d7e2fc8e6857a80a738c Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Wed, 15 May 2024 07:34:02 +0300 Subject: [PATCH 32/36] Updated GatewayClient to account for IPartialMessage --- NetCord/Gateway/GatewayClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 0a27ccd7..67ebf2c0 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -462,7 +462,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// /// Sent when a message is updated. - /// The inner payload is a message object with the same set fields as . Updates may contain only a partial object, in which case they are not handled by NetCord.
+ /// The inner payload is a partial message object, with only the message's ID and Guild ID being guaranteed present, all other fields can be null.
///
Required Intents: , * ///
Optional Intents: /// @@ -501,7 +501,7 @@ public partial class GatewayClient : WebSocketClient, IEntity ///

/// *Ephemeral messages do not use the guild channel. Because of this, they are tied to the intent, and the message object won't include a or . ///
- public event Func? MessageUpdate; + public event Func? MessageUpdate; /// /// Sent when a message is deleted.
From 5235441f732bdff87c3d4c1795c0cbd1955c868e Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sat, 18 May 2024 00:03:58 +0300 Subject: [PATCH 33/36] Documented all ShardedGatewayClient events. --- NetCord/Gateway/ShardedGatewayClient.cs | 388 ++++++++++++++---------- 1 file changed, 229 insertions(+), 159 deletions(-) diff --git a/NetCord/Gateway/ShardedGatewayClient.cs b/NetCord/Gateway/ShardedGatewayClient.cs index 22bbfad4..0404ef3b 100644 --- a/NetCord/Gateway/ShardedGatewayClient.cs +++ b/NetCord/Gateway/ShardedGatewayClient.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System.Collections; using NetCord.Rest; @@ -331,22 +331,6 @@ private void HookEvents(GatewayClient client) HookEvent(client, _unknownEventLock, ref _unknownEvent, a => _unknownEvent!(client, a), (c, e) => c.UnknownEvent += e); } - private readonly object _readyLock = new(); - private Func? _ready; - public event Func? Ready - { - add - { - HookEvent(_readyLock, value, ref _ready, client => a => _ready!(client, a), (c, e) => c.Ready += e); - } - remove - { - UnhookEvent(_readyLock, value, ref _ready, (c, e) => c.Ready -= e); - } - } - - private readonly object _latencyUpdateLock = new(); - private Func? _latencyUpdate; public event Func? LatencyUpdate { add @@ -358,9 +342,9 @@ public event Func? LatencyUpdate UnhookEvent(_latencyUpdateLock, value, ref _latencyUpdate, (c, e) => c.LatencyUpdate -= e); } } + private Func? _latencyUpdate; + private readonly object _latencyUpdateLock = new(); - private readonly object _resumeLock = new(); - private Func? _resume; public event Func? Resume { add @@ -372,9 +356,9 @@ public event Func? Resume UnhookEvent(_resumeLock, value, ref _resume, (c, e) => c.Resume -= e); } } + private Func? _resume; + private readonly object _resumeLock = new(); - private readonly object _connectingLock = new(); - private Func? _connecting; public event Func? Connecting { add @@ -386,9 +370,9 @@ public event Func? Connecting UnhookEvent(_connectingLock, value, ref _connecting, (c, e) => c.Connecting -= e); } } + private Func? _connecting; + private readonly object _connectingLock = new(); - private readonly object _connectLock = new(); - private Func? _connect; public event Func? Connect { add @@ -400,9 +384,9 @@ public event Func? Connect UnhookEvent(_connectLock, value, ref _connect, (c, e) => c.Connect -= e); } } + private Func? _connect; + private readonly object _connectLock = new(); - private readonly object _disconnectLock = new(); - private Func? _disconnect; public event Func? Disconnect { add @@ -414,9 +398,9 @@ public event Func? Disconnect UnhookEvent(_disconnectLock, value, ref _disconnect, (c, e) => c.Disconnect -= e); } } + private Func? _disconnect; + private readonly object _disconnectLock = new(); - private readonly object _closeLock = new(); - private Func? _close; public event Func? Close { add @@ -428,9 +412,9 @@ public event Func? Close UnhookEvent(_closeLock, value, ref _close, (c, e) => c.Close -= e); } } + private Func? _close; + private readonly object _closeLock = new(); - private readonly object _logLock = new(); - private Func? _log; public event Func? Log { add @@ -442,9 +426,27 @@ public event Func? Log UnhookEvent(_logLock, value, ref _log, (c, e) => c.Log -= e); } } + private Func? _log; + private readonly object _logLock = new(); - private readonly object _applicationCommandPermissionsUpdateLock = new(); - private Func? _applicationCommandPermissionsUpdate; + #region Events + + /// + public event Func? Ready + { + add + { + HookEvent(_readyLock, value, ref _ready, client => a => _ready!(client, a), (c, e) => c.Ready += e); + } + remove + { + UnhookEvent(_readyLock, value, ref _ready, (c, e) => c.Ready -= e); + } + } + private Func? _ready; + private readonly object _readyLock = new(); + + /// public event Func? ApplicationCommandPermissionsUpdate { add @@ -456,9 +458,10 @@ public event Func? Appli UnhookEvent(_applicationCommandPermissionsUpdateLock, value, ref _applicationCommandPermissionsUpdate, (c, e) => c.ApplicationCommandPermissionsUpdate -= e); } } + private Func? _applicationCommandPermissionsUpdate; + private readonly object _applicationCommandPermissionsUpdateLock = new(); - private readonly object _autoModerationRuleCreateLock = new(); - private Func? _autoModerationRuleCreate; + /// public event Func? AutoModerationRuleCreate { add @@ -470,9 +473,10 @@ public event Func? AutoModerationR UnhookEvent(_autoModerationRuleCreateLock, value, ref _autoModerationRuleCreate, (c, e) => c.AutoModerationRuleCreate -= e); } } + private Func? _autoModerationRuleCreate; + private readonly object _autoModerationRuleCreateLock = new(); - private readonly object _autoModerationRuleUpdateLock = new(); - private Func? _autoModerationRuleUpdate; + /// public event Func? AutoModerationRuleUpdate { add @@ -484,9 +488,10 @@ public event Func? AutoModerationR UnhookEvent(_autoModerationRuleUpdateLock, value, ref _autoModerationRuleUpdate, (c, e) => c.AutoModerationRuleUpdate -= e); } } + private Func? _autoModerationRuleUpdate; + private readonly object _autoModerationRuleUpdateLock = new(); - private readonly object _autoModerationRuleDeleteLock = new(); - private Func? _autoModerationRuleDelete; + /// public event Func? AutoModerationRuleDelete { add @@ -498,9 +503,10 @@ public event Func? AutoModerationR UnhookEvent(_autoModerationRuleDeleteLock, value, ref _autoModerationRuleDelete, (c, e) => c.AutoModerationRuleDelete -= e); } } + private Func? _autoModerationRuleDelete; + private readonly object _autoModerationRuleDeleteLock = new(); - private readonly object _autoModerationActionExecutionLock = new(); - private Func? _autoModerationActionExecution; + /// public event Func? AutoModerationActionExecution { add @@ -512,9 +518,10 @@ public event Func c.AutoModerationActionExecution -= e); } } + private Func? _autoModerationActionExecution; + private readonly object _autoModerationActionExecutionLock = new(); - private readonly object _guildChannelCreateLock = new(); - private Func? _guildChannelCreate; + /// public event Func? GuildChannelCreate { add @@ -526,9 +533,10 @@ public event Func? GuildChannelCreate UnhookEvent(_guildChannelCreateLock, value, ref _guildChannelCreate, (c, e) => c.GuildChannelCreate -= e); } } + private Func? _guildChannelCreate; + private readonly object _guildChannelCreateLock = new(); - private readonly object _guildChannelUpdateLock = new(); - private Func? _guildChannelUpdate; + /// public event Func? GuildChannelUpdate { add @@ -540,9 +548,10 @@ public event Func? GuildChannelUpdate UnhookEvent(_guildChannelUpdateLock, value, ref _guildChannelUpdate, (c, e) => c.GuildChannelUpdate -= e); } } + private Func? _guildChannelUpdate; + private readonly object _guildChannelUpdateLock = new(); - private readonly object _guildChannelDeleteLock = new(); - private Func? _guildChannelDelete; + /// public event Func? GuildChannelDelete { add @@ -554,9 +563,10 @@ public event Func? GuildChannelDelete UnhookEvent(_guildChannelDeleteLock, value, ref _guildChannelDelete, (c, e) => c.GuildChannelDelete -= e); } } + private Func? _guildChannelDelete; + private readonly object _guildChannelDeleteLock = new(); - private readonly object _channelPinsUpdateLock = new(); - private Func? _channelPinsUpdate; + /// public event Func? ChannelPinsUpdate { add @@ -568,9 +578,10 @@ public event Func? Channel UnhookEvent(_channelPinsUpdateLock, value, ref _channelPinsUpdate, (c, e) => c.ChannelPinsUpdate -= e); } } + private Func? _channelPinsUpdate; + private readonly object _channelPinsUpdateLock = new(); - private readonly object _guildThreadCreateLock = new(); - private Func? _guildThreadCreate; + /// public event Func? GuildThreadCreate { add @@ -582,9 +593,10 @@ public event Func? GuildTh UnhookEvent(_guildThreadCreateLock, value, ref _guildThreadCreate, (c, e) => c.GuildThreadCreate -= e); } } + private Func? _guildThreadCreate; + private readonly object _guildThreadCreateLock = new(); - private readonly object _guildThreadUpdateLock = new(); - private Func? _guildThreadUpdate; + /// public event Func? GuildThreadUpdate { add @@ -596,9 +608,10 @@ public event Func? GuildThreadUpdate UnhookEvent(_guildThreadUpdateLock, value, ref _guildThreadUpdate, (c, e) => c.GuildThreadUpdate -= e); } } + private Func? _guildThreadUpdate; + private readonly object _guildThreadUpdateLock = new(); - private readonly object _guildThreadDeleteLock = new(); - private Func? _guildThreadDelete; + /// public event Func? GuildThreadDelete { add @@ -610,9 +623,10 @@ public event Func? GuildTh UnhookEvent(_guildThreadDeleteLock, value, ref _guildThreadDelete, (c, e) => c.GuildThreadDelete -= e); } } + private Func? _guildThreadDelete; + private readonly object _guildThreadDeleteLock = new(); - private readonly object _guildThreadListSyncLock = new(); - private Func? _guildThreadListSync; + /// public event Func? GuildThreadListSync { add @@ -624,9 +638,10 @@ public event Func? Guild UnhookEvent(_guildThreadListSyncLock, value, ref _guildThreadListSync, (c, e) => c.GuildThreadListSync -= e); } } + private Func? _guildThreadListSync; + private readonly object _guildThreadListSyncLock = new(); - private readonly object _guildThreadUserUpdateLock = new(); - private Func? _guildThreadUserUpdate; + /// public event Func? GuildThreadUserUpdate { add @@ -638,9 +653,10 @@ public event Func? Gui UnhookEvent(_guildThreadUserUpdateLock, value, ref _guildThreadUserUpdate, (c, e) => c.GuildThreadUserUpdate -= e); } } + private Func? _guildThreadUserUpdate; + private readonly object _guildThreadUserUpdateLock = new(); - private readonly object _guildThreadUsersUpdateLock = new(); - private Func? _guildThreadUsersUpdate; + /// public event Func? GuildThreadUsersUpdate { add @@ -652,9 +668,10 @@ public event Func? Gu UnhookEvent(_guildThreadUsersUpdateLock, value, ref _guildThreadUsersUpdate, (c, e) => c.GuildThreadUsersUpdate -= e); } } + private Func? _guildThreadUsersUpdate; + private readonly object _guildThreadUsersUpdateLock = new(); - private readonly object _guildCreateLock = new(); - private Func? _guildCreate; + /// public event Func? GuildCreate { add @@ -666,9 +683,10 @@ public event Func? GuildCreate UnhookEvent(_guildCreateLock, value, ref _guildCreate, (c, e) => c.GuildCreate -= e); } } + private Func? _guildCreate; + private readonly object _guildCreateLock = new(); - private readonly object _guildUpdateLock = new(); - private Func? _guildUpdate; + /// public event Func? GuildUpdate { add @@ -680,9 +698,10 @@ public event Func? GuildUpdate UnhookEvent(_guildUpdateLock, value, ref _guildUpdate, (c, e) => c.GuildUpdate -= e); } } + private Func? _guildUpdate; + private readonly object _guildUpdateLock = new(); - private readonly object _guildDeleteLock = new(); - private Func? _guildDelete; + /// public event Func? GuildDelete { add @@ -694,9 +713,10 @@ public event Func? GuildDelete UnhookEvent(_guildDeleteLock, value, ref _guildDelete, (c, e) => c.GuildDelete -= e); } } + private Func? _guildDelete; + private readonly object _guildDeleteLock = new(); - private readonly object _guildAuditLogEntryCreateLock = new(); - private Func? _guildAuditLogEntryCreate; + /// public event Func? GuildAuditLogEntryCreate { add @@ -708,9 +728,10 @@ public event Func? GuildAuditLogEntryCr UnhookEvent(_guildAuditLogEntryCreateLock, value, ref _guildAuditLogEntryCreate, (c, e) => c.GuildAuditLogEntryCreate -= e); } } + private Func? _guildAuditLogEntryCreate; + private readonly object _guildAuditLogEntryCreateLock = new(); - private readonly object _guildBanAddLock = new(); - private Func? _guildBanAdd; + /// public event Func? GuildBanAdd { add @@ -722,9 +743,10 @@ public event Func? GuildBanAdd UnhookEvent(_guildBanAddLock, value, ref _guildBanAdd, (c, e) => c.GuildBanAdd -= e); } } + private Func? _guildBanAdd; + private readonly object _guildBanAddLock = new(); - private readonly object _guildBanRemoveLock = new(); - private Func? _guildBanRemove; + /// public event Func? GuildBanRemove { add @@ -736,9 +758,10 @@ public event Func? GuildBanRemove UnhookEvent(_guildBanRemoveLock, value, ref _guildBanRemove, (c, e) => c.GuildBanRemove -= e); } } + private Func? _guildBanRemove; + private readonly object _guildBanRemoveLock = new(); - private readonly object _guildEmojisUpdateLock = new(); - private Func? _guildEmojisUpdate; + /// public event Func? GuildEmojisUpdate { add @@ -750,9 +773,10 @@ public event Func? GuildEm UnhookEvent(_guildEmojisUpdateLock, value, ref _guildEmojisUpdate, (c, e) => c.GuildEmojisUpdate -= e); } } + private Func? _guildEmojisUpdate; + private readonly object _guildEmojisUpdateLock = new(); - private readonly object _guildStickersUpdateLock = new(); - private Func? _guildStickersUpdate; + /// public event Func? GuildStickersUpdate { add @@ -764,9 +788,10 @@ public event Func? Guild UnhookEvent(_guildStickersUpdateLock, value, ref _guildStickersUpdate, (c, e) => c.GuildStickersUpdate -= e); } } + private Func? _guildStickersUpdate; + private readonly object _guildStickersUpdateLock = new(); - private readonly object _guildIntegrationsUpdateLock = new(); - private Func? _guildIntegrationsUpdate; + /// public event Func? GuildIntegrationsUpdate { add @@ -778,9 +803,10 @@ public event Func? G UnhookEvent(_guildIntegrationsUpdateLock, value, ref _guildIntegrationsUpdate, (c, e) => c.GuildIntegrationsUpdate -= e); } } + private Func? _guildIntegrationsUpdate; + private readonly object _guildIntegrationsUpdateLock = new(); - private readonly object _guildUserAddLock = new(); - private Func? _guildUserAdd; + /// public event Func? GuildUserAdd { add @@ -792,9 +818,10 @@ public event Func? GuildUserAdd UnhookEvent(_guildUserAddLock, value, ref _guildUserAdd, (c, e) => c.GuildUserAdd -= e); } } + private Func? _guildUserAdd; + private readonly object _guildUserAddLock = new(); - private readonly object _guildUserUpdateLock = new(); - private Func? _guildUserUpdate; + /// public event Func? GuildUserUpdate { add @@ -806,9 +833,10 @@ public event Func? GuildUserUpdate UnhookEvent(_guildUserUpdateLock, value, ref _guildUserUpdate, (c, e) => c.GuildUserUpdate -= e); } } + private Func? _guildUserUpdate; + private readonly object _guildUserUpdateLock = new(); - private readonly object _guildUserRemoveLock = new(); - private Func? _guildUserRemove; + /// public event Func? GuildUserRemove { add @@ -820,9 +848,10 @@ public event Func? GuildUser UnhookEvent(_guildUserRemoveLock, value, ref _guildUserRemove, (c, e) => c.GuildUserRemove -= e); } } + private Func? _guildUserRemove; + private readonly object _guildUserRemoveLock = new(); - private readonly object _guildUserChunkLock = new(); - private Func? _guildUserChunk; + /// public event Func? GuildUserChunk { add @@ -834,9 +863,10 @@ public event Func? GuildUserC UnhookEvent(_guildUserChunkLock, value, ref _guildUserChunk, (c, e) => c.GuildUserChunk -= e); } } + private Func? _guildUserChunk; + private readonly object _guildUserChunkLock = new(); - private readonly object _roleCreateLock = new(); - private Func? _roleCreate; + /// public event Func? RoleCreate { add @@ -848,9 +878,10 @@ public event Func? RoleCreate UnhookEvent(_roleCreateLock, value, ref _roleCreate, (c, e) => c.RoleCreate -= e); } } + private Func? _roleCreate; + private readonly object _roleCreateLock = new(); - private readonly object _roleUpdateLock = new(); - private Func? _roleUpdate; + /// public event Func? RoleUpdate { add @@ -862,9 +893,10 @@ public event Func? RoleUpdate UnhookEvent(_roleUpdateLock, value, ref _roleUpdate, (c, e) => c.RoleUpdate -= e); } } + private Func? _roleUpdate; + private readonly object _roleUpdateLock = new(); - private readonly object _roleDeleteLock = new(); - private Func? _roleDelete; + /// public event Func? RoleDelete { add @@ -876,9 +908,10 @@ public event Func? RoleDelete UnhookEvent(_roleDeleteLock, value, ref _roleDelete, (c, e) => c.RoleDelete -= e); } } + private Func? _roleDelete; + private readonly object _roleDeleteLock = new(); - private readonly object _guildScheduledEventCreateLock = new(); - private Func? _guildScheduledEventCreate; + /// public event Func? GuildScheduledEventCreate { add @@ -890,9 +923,10 @@ public event Func? GuildScheduled UnhookEvent(_guildScheduledEventCreateLock, value, ref _guildScheduledEventCreate, (c, e) => c.GuildScheduledEventCreate -= e); } } + private Func? _guildScheduledEventCreate; + private readonly object _guildScheduledEventCreateLock = new(); - private readonly object _guildScheduledEventUpdateLock = new(); - private Func? _guildScheduledEventUpdate; + /// public event Func? GuildScheduledEventUpdate { add @@ -904,9 +938,10 @@ public event Func? GuildScheduled UnhookEvent(_guildScheduledEventUpdateLock, value, ref _guildScheduledEventUpdate, (c, e) => c.GuildScheduledEventUpdate -= e); } } + private Func? _guildScheduledEventUpdate; + private readonly object _guildScheduledEventUpdateLock = new(); - private readonly object _guildScheduledEventDeleteLock = new(); - private Func? _guildScheduledEventDelete; + /// public event Func? GuildScheduledEventDelete { add @@ -918,9 +953,10 @@ public event Func? GuildScheduled UnhookEvent(_guildScheduledEventDeleteLock, value, ref _guildScheduledEventDelete, (c, e) => c.GuildScheduledEventDelete -= e); } } + private Func? _guildScheduledEventDelete; + private readonly object _guildScheduledEventDeleteLock = new(); - private readonly object _guildScheduledEventUserAddLock = new(); - private Func? _guildScheduledEventUserAdd; + /// public event Func? GuildScheduledEventUserAdd { add @@ -932,9 +968,10 @@ public event Func? G UnhookEvent(_guildScheduledEventUserAddLock, value, ref _guildScheduledEventUserAdd, (c, e) => c.GuildScheduledEventUserAdd -= e); } } + private Func? _guildScheduledEventUserAdd; + private readonly object _guildScheduledEventUserAddLock = new(); - private readonly object _guildScheduledEventUserRemoveLock = new(); - private Func? _guildScheduledEventUserRemove; + /// public event Func? GuildScheduledEventUserRemove { add @@ -946,9 +983,10 @@ public event Func? G UnhookEvent(_guildScheduledEventUserRemoveLock, value, ref _guildScheduledEventUserRemove, (c, e) => c.GuildScheduledEventUserRemove -= e); } } + private Func? _guildScheduledEventUserRemove; + private readonly object _guildScheduledEventUserRemoveLock = new(); - private readonly object _guildIntegrationCreateLock = new(); - private Func? _guildIntegrationCreate; + /// public event Func? GuildIntegrationCreate { add @@ -960,9 +998,10 @@ public event Func? GuildInt UnhookEvent(_guildIntegrationCreateLock, value, ref _guildIntegrationCreate, (c, e) => c.GuildIntegrationCreate -= e); } } + private Func? _guildIntegrationCreate; + private readonly object _guildIntegrationCreateLock = new(); - private readonly object _guildIntegrationUpdateLock = new(); - private Func? _guildIntegrationUpdate; + /// public event Func? GuildIntegrationUpdate { add @@ -974,9 +1013,10 @@ public event Func? GuildInt UnhookEvent(_guildIntegrationUpdateLock, value, ref _guildIntegrationUpdate, (c, e) => c.GuildIntegrationUpdate -= e); } } + private Func? _guildIntegrationUpdate; + private readonly object _guildIntegrationUpdateLock = new(); - private readonly object _guildIntegrationDeleteLock = new(); - private Func? _guildIntegrationDelete; + /// public event Func? GuildIntegrationDelete { add @@ -988,9 +1028,10 @@ public event Func? Gu UnhookEvent(_guildIntegrationDeleteLock, value, ref _guildIntegrationDelete, (c, e) => c.GuildIntegrationDelete -= e); } } + private Func? _guildIntegrationDelete; + private readonly object _guildIntegrationDeleteLock = new(); - private readonly object _guildInviteCreateLock = new(); - private Func? _guildInviteCreate; + /// public event Func? GuildInviteCreate { add @@ -1002,9 +1043,10 @@ public event Func? GuildInviteCreate UnhookEvent(_guildInviteCreateLock, value, ref _guildInviteCreate, (c, e) => c.GuildInviteCreate -= e); } } + private Func? _guildInviteCreate; + private readonly object _guildInviteCreateLock = new(); - private readonly object _guildInviteDeleteLock = new(); - private Func? _guildInviteDelete; + /// public event Func? GuildInviteDelete { add @@ -1016,9 +1058,10 @@ public event Func? GuildIn UnhookEvent(_guildInviteDeleteLock, value, ref _guildInviteDelete, (c, e) => c.GuildInviteDelete -= e); } } + private Func? _guildInviteDelete; + private readonly object _guildInviteDeleteLock = new(); - private readonly object _messageCreateLock = new(); - private Func? _messageCreate; + /// public event Func? MessageCreate { add @@ -1030,9 +1073,10 @@ public event Func? MessageCreate UnhookEvent(_messageCreateLock, value, ref _messageCreate, (c, e) => c.MessageCreate -= e); } } + private Func? _messageCreate; + private readonly object _messageCreateLock = new(); - private readonly object _messageUpdateLock = new(); - private Func? _messageUpdate; + /// public event Func? MessageUpdate { add @@ -1044,9 +1088,10 @@ public event Func? MessageUpdate UnhookEvent(_messageUpdateLock, value, ref _messageUpdate, (c, e) => c.MessageUpdate -= e); } } + private Func? _messageUpdate; + private readonly object _messageUpdateLock = new(); - private readonly object _messageDeleteLock = new(); - private Func? _messageDelete; + /// public event Func? MessageDelete { add @@ -1058,9 +1103,10 @@ public event Func? MessageDele UnhookEvent(_messageDeleteLock, value, ref _messageDelete, (c, e) => c.MessageDelete -= e); } } + private Func? _messageDelete; + private readonly object _messageDeleteLock = new(); - private readonly object _messageDeleteBulkLock = new(); - private Func? _messageDeleteBulk; + /// public event Func? MessageDeleteBulk { add @@ -1072,9 +1118,10 @@ public event Func? Message UnhookEvent(_messageDeleteBulkLock, value, ref _messageDeleteBulk, (c, e) => c.MessageDeleteBulk -= e); } } + private Func? _messageDeleteBulk; + private readonly object _messageDeleteBulkLock = new(); - private readonly object _messageReactionAddLock = new(); - private Func? _messageReactionAdd; + /// public event Func? MessageReactionAdd { add @@ -1086,9 +1133,10 @@ public event Func? Messag UnhookEvent(_messageReactionAddLock, value, ref _messageReactionAdd, (c, e) => c.MessageReactionAdd -= e); } } + private Func? _messageReactionAdd; + private readonly object _messageReactionAddLock = new(); - private readonly object _messageReactionRemoveLock = new(); - private Func? _messageReactionRemove; + /// public event Func? MessageReactionRemove { add @@ -1100,9 +1148,10 @@ public event Func? Mes UnhookEvent(_messageReactionRemoveLock, value, ref _messageReactionRemove, (c, e) => c.MessageReactionRemove -= e); } } + private Func? _messageReactionRemove; + private readonly object _messageReactionRemoveLock = new(); - private readonly object _messageReactionRemoveAllLock = new(); - private Func? _messageReactionRemoveAll; + /// public event Func? MessageReactionRemoveAll { add @@ -1114,9 +1163,10 @@ public event Func? UnhookEvent(_messageReactionRemoveAllLock, value, ref _messageReactionRemoveAll, (c, e) => c.MessageReactionRemoveAll -= e); } } + private Func? _messageReactionRemoveAll; + private readonly object _messageReactionRemoveAllLock = new(); - private readonly object _messageReactionRemoveEmojiLock = new(); - private Func? _messageReactionRemoveEmoji; + /// public event Func? MessageReactionRemoveEmoji { add @@ -1128,9 +1178,10 @@ public event Func UnhookEvent(_messageReactionRemoveEmojiLock, value, ref _messageReactionRemoveEmoji, (c, e) => c.MessageReactionRemoveEmoji -= e); } } + private Func? _messageReactionRemoveEmoji; + private readonly object _messageReactionRemoveEmojiLock = new(); - private readonly object _presenceUpdateLock = new(); - private Func? _presenceUpdate; + /// public event Func? PresenceUpdate { add @@ -1142,9 +1193,10 @@ public event Func? PresenceUpdate UnhookEvent(_presenceUpdateLock, value, ref _presenceUpdate, (c, e) => c.PresenceUpdate -= e); } } + private Func? _presenceUpdate; + private readonly object _presenceUpdateLock = new(); - private readonly object _typingStartLock = new(); - private Func? _typingStart; + /// public event Func? TypingStart { add @@ -1156,9 +1208,10 @@ public event Func? TypingStart UnhookEvent(_typingStartLock, value, ref _typingStart, (c, e) => c.TypingStart -= e); } } + private Func? _typingStart; + private readonly object _typingStartLock = new(); - private readonly object _currentUserUpdateLock = new(); - private Func? _currentUserUpdate; + /// public event Func? CurrentUserUpdate { add @@ -1170,9 +1223,10 @@ public event Func? CurrentUserUpdate UnhookEvent(_currentUserUpdateLock, value, ref _currentUserUpdate, (c, e) => c.CurrentUserUpdate -= e); } } + private Func? _currentUserUpdate; + private readonly object _currentUserUpdateLock = new(); - private readonly object _voiceStateUpdateLock = new(); - private Func? _voiceStateUpdate; + /// public event Func? VoiceStateUpdate { add @@ -1184,9 +1238,10 @@ public event Func? VoiceStateUpdate UnhookEvent(_voiceStateUpdateLock, value, ref _voiceStateUpdate, (c, e) => c.VoiceStateUpdate -= e); } } + private Func? _voiceStateUpdate; + private readonly object _voiceStateUpdateLock = new(); - private readonly object _voiceServerUpdateLock = new(); - private Func? _voiceServerUpdate; + /// public event Func? VoiceServerUpdate { add @@ -1198,9 +1253,10 @@ public event Func? VoiceSe UnhookEvent(_voiceServerUpdateLock, value, ref _voiceServerUpdate, (c, e) => c.VoiceServerUpdate -= e); } } + private Func? _voiceServerUpdate; + private readonly object _voiceServerUpdateLock = new(); - private readonly object _webhooksUpdateLock = new(); - private Func? _webhooksUpdate; + /// public event Func? WebhooksUpdate { add @@ -1212,9 +1268,10 @@ public event Func? WebhooksUp UnhookEvent(_webhooksUpdateLock, value, ref _webhooksUpdate, (c, e) => c.WebhooksUpdate -= e); } } + private Func? _webhooksUpdate; + private readonly object _webhooksUpdateLock = new(); - private readonly object _interactionCreateLock = new(); - private Func? _interactionCreate; + /// public event Func? InteractionCreate { add @@ -1226,9 +1283,10 @@ public event Func? InteractionCreate UnhookEvent(_interactionCreateLock, value, ref _interactionCreate, (c, e) => c.InteractionCreate -= e); } } + private Func? _interactionCreate; + private readonly object _interactionCreateLock = new(); - private readonly object _stageInstanceCreateLock = new(); - private Func? _stageInstanceCreate; + /// public event Func? StageInstanceCreate { add @@ -1240,9 +1298,10 @@ public event Func? StageInstanceCreate UnhookEvent(_stageInstanceCreateLock, value, ref _stageInstanceCreate, (c, e) => c.StageInstanceCreate -= e); } } + private Func? _stageInstanceCreate; + private readonly object _stageInstanceCreateLock = new(); - private readonly object _stageInstanceUpdateLock = new(); - private Func? _stageInstanceUpdate; + /// public event Func? StageInstanceUpdate { add @@ -1254,9 +1313,10 @@ public event Func? StageInstanceUpdate UnhookEvent(_stageInstanceUpdateLock, value, ref _stageInstanceUpdate, (c, e) => c.StageInstanceUpdate -= e); } } + private Func? _stageInstanceUpdate; + private readonly object _stageInstanceUpdateLock = new(); - private readonly object _stageInstanceDeleteLock = new(); - private Func? _stageInstanceDelete; + /// public event Func? StageInstanceDelete { add @@ -1268,9 +1328,10 @@ public event Func? StageInstanceDelete UnhookEvent(_stageInstanceDeleteLock, value, ref _stageInstanceDelete, (c, e) => c.StageInstanceDelete -= e); } } + private Func? _stageInstanceDelete; + private readonly object _stageInstanceDeleteLock = new(); - private readonly object _entitlementCreateLock = new(); - private Func? _entitlementCreate; + /// public event Func? EntitlementCreate { add @@ -1282,9 +1343,10 @@ public event Func? EntitlementCreate UnhookEvent(_entitlementCreateLock, value, ref _entitlementCreate, (c, e) => c.EntitlementCreate -= e); } } + private Func? _entitlementCreate; + private readonly object _entitlementCreateLock = new(); - private readonly object _entitlementUpdateLock = new(); - private Func? _entitlementUpdate; + /// public event Func? EntitlementUpdate { add @@ -1296,9 +1358,10 @@ public event Func? EntitlementUpdate UnhookEvent(_entitlementUpdateLock, value, ref _entitlementUpdate, (c, e) => c.EntitlementUpdate -= e); } } + private Func? _entitlementUpdate; + private readonly object _entitlementUpdateLock = new(); - private readonly object _entitlementDeleteLock = new(); - private Func? _entitlementDelete; + /// public event Func? EntitlementDelete { add @@ -1310,9 +1373,10 @@ public event Func? EntitlementDelete UnhookEvent(_entitlementDeleteLock, value, ref _entitlementDelete, (c, e) => c.EntitlementDelete -= e); } } + private Func? _entitlementDelete; + private readonly object _entitlementDeleteLock = new(); - private readonly object _guildJoinRequestUpdateLock = new(); - private Func? _guildJoinRequestUpdate; + /// public event Func? GuildJoinRequestUpdate { add @@ -1324,9 +1388,10 @@ public event Func? Gu UnhookEvent(_guildJoinRequestUpdateLock, value, ref _guildJoinRequestUpdate, (c, e) => c.GuildJoinRequestUpdate -= e); } } + private Func? _guildJoinRequestUpdate; + private readonly object _guildJoinRequestUpdateLock = new(); - private readonly object _guildJoinRequestDeleteLock = new(); - private Func? _guildJoinRequestDelete; + /// public event Func? GuildJoinRequestDelete { add @@ -1338,9 +1403,10 @@ public event Func? Gu UnhookEvent(_guildJoinRequestDeleteLock, value, ref _guildJoinRequestDelete, (c, e) => c.GuildJoinRequestDelete -= e); } } + private Func? _guildJoinRequestDelete; + private readonly object _guildJoinRequestDeleteLock = new(); - private readonly object _unknownEventLock = new(); - private Func? _unknownEvent; + /// public event Func? UnknownEvent { add @@ -1352,6 +1418,10 @@ public event Func? UnknownEvent UnhookEvent(_unknownEventLock, value, ref _unknownEvent, (c, e) => c.UnknownEvent -= e); } } + private Func? _unknownEvent; + private readonly object _unknownEventLock = new(); + + #endregion private void HookEvent(GatewayClient client, object @lock, ref Func? eventRef, Func @delegate, Action> addGatewayClientEvent) { From 2352ec111f25b7dc0eb6827713c23df56586a29b Mon Sep 17 00:00:00 2001 From: Red-K0 <114494949+Red-K0@users.noreply.github.com> Date: Sat, 18 May 2024 00:06:21 +0300 Subject: [PATCH 34/36] Merge conflict fixes. --- NetCord/Gateway/ShardedGatewayClient.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NetCord/Gateway/ShardedGatewayClient.cs b/NetCord/Gateway/ShardedGatewayClient.cs index 0404ef3b..97d4fc6f 100644 --- a/NetCord/Gateway/ShardedGatewayClient.cs +++ b/NetCord/Gateway/ShardedGatewayClient.cs @@ -867,7 +867,7 @@ public event Func? GuildUserC private readonly object _guildUserChunkLock = new(); /// - public event Func? RoleCreate + public event Func? RoleCreate { add { @@ -878,11 +878,11 @@ public event Func? RoleCreate UnhookEvent(_roleCreateLock, value, ref _roleCreate, (c, e) => c.RoleCreate -= e); } } - private Func? _roleCreate; + private Func? _roleCreate; private readonly object _roleCreateLock = new(); /// - public event Func? RoleUpdate + public event Func? RoleUpdate { add { @@ -893,7 +893,7 @@ public event Func? RoleUpdate UnhookEvent(_roleUpdateLock, value, ref _roleUpdate, (c, e) => c.RoleUpdate -= e); } } - private Func? _roleUpdate; + private Func? _roleUpdate; private readonly object _roleUpdateLock = new(); /// @@ -1077,7 +1077,7 @@ public event Func? MessageCreate private readonly object _messageCreateLock = new(); /// - public event Func? MessageUpdate + public event Func? MessageUpdate { add { From 774e7ac2e67b3fc504ec30aad097c42c3a931b90 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Fri, 17 May 2024 23:10:34 +0200 Subject: [PATCH 35/36] Cleanup --- NetCord/Gateway/GatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/GatewayClient.cs b/NetCord/Gateway/GatewayClient.cs index 67ebf2c0..819e226f 100644 --- a/NetCord/Gateway/GatewayClient.cs +++ b/NetCord/Gateway/GatewayClient.cs @@ -638,7 +638,7 @@ public partial class GatewayClient : WebSocketClient, IEntity /// An unknown event. ///
public event Func? UnknownEvent; - + #endregion /// From 69a5a204b4dd59b96cb3ee6266289805323f9747 Mon Sep 17 00:00:00 2001 From: KubaZ2 Date: Fri, 17 May 2024 23:16:36 +0200 Subject: [PATCH 36/36] Fix merge conflicts --- NetCord/Gateway/ShardedGatewayClient.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetCord/Gateway/ShardedGatewayClient.cs b/NetCord/Gateway/ShardedGatewayClient.cs index 97d4fc6f..2fa52a84 100644 --- a/NetCord/Gateway/ShardedGatewayClient.cs +++ b/NetCord/Gateway/ShardedGatewayClient.cs @@ -1088,7 +1088,7 @@ public event Func? MessageUpdate UnhookEvent(_messageUpdateLock, value, ref _messageUpdate, (c, e) => c.MessageUpdate -= e); } } - private Func? _messageUpdate; + private Func? _messageUpdate; private readonly object _messageUpdateLock = new(); ///