From 17a4af71ee8062966bfe477d4d9ea68b490cfb77 Mon Sep 17 00:00:00 2001 From: Still Hsu <341464@gmail.com> Date: Tue, 29 May 2018 17:15:10 +0800 Subject: [PATCH] Add documentation for new API version & few events --- src/Discord.Net.Core/DiscordConfig.cs | 9 +++++- .../BaseSocketClient.Events.cs | 32 +++++++++++++++---- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/src/Discord.Net.Core/DiscordConfig.cs b/src/Discord.Net.Core/DiscordConfig.cs index c6ad799151..d0c1c3a84b 100644 --- a/src/Discord.Net.Core/DiscordConfig.cs +++ b/src/Discord.Net.Core/DiscordConfig.cs @@ -11,12 +11,19 @@ public class DiscordConfig /// Returns the API version Discord.Net uses. /// /// - /// A 32-bit integer representing the API version that Discord.Net uses to communicate with Discord. + /// An representing the API version that Discord.Net uses to communicate with Discord. /// A list of available API version can be seen on the official /// Discord API documentation /// . /// public const int APIVersion = 6; + /// + /// Returns the Voice API version Discord.Net uses. + /// + /// + /// An representing the API version that Discord.Net uses to communicate with Discord's + /// voice server. + /// public const int VoiceAPIVersion = 3; /// /// Gets the Discord.Net version, including the build number. diff --git a/src/Discord.Net.WebSocket/BaseSocketClient.Events.cs b/src/Discord.Net.WebSocket/BaseSocketClient.Events.cs index 9a94cbf235..db4eb9c94d 100644 --- a/src/Discord.Net.WebSocket/BaseSocketClient.Events.cs +++ b/src/Discord.Net.WebSocket/BaseSocketClient.Events.cs @@ -10,7 +10,7 @@ public partial class BaseSocketClient /// /// /// This event is fired when a generic channel has been created. The event handler must return a - /// . + /// and accept a as its parameter. /// /// /// The newly created channel is passed into the event handler parameter. The given channel type may @@ -28,7 +28,7 @@ public event Func ChannelCreated /// /// /// This event is fired when a generic channel has been destroyed. The event handler must return a - /// . + /// and accept a as its parameter. /// /// /// The destroyed channel is passed into the event handler parameter. The given channel type may @@ -45,7 +45,7 @@ public event Func ChannelDestroyed { /// /// /// This event is fired when a generic channel has been destroyed. The event handler must return a - /// . + /// and accept 2 as its parameters. /// /// /// The original (prior to update) channel is passed into the first , while @@ -65,13 +65,13 @@ public event Func ChannelUpdated { /// /// /// This event is fired when a message is received. The event handler must return a - /// . + /// and accept a as its parameter. /// /// /// The message that is sent to the client is passed into the event handler parameter as /// . This message may be a system message (i.e. - /// ) or a user message (i.e. . See - /// the derived clsases of for more details. + /// ) or a user message (i.e. . See the + /// derived clsases of for more details. /// /// public event Func MessageReceived { @@ -108,6 +108,26 @@ public event Func, ISocketMessageChannel, Task> Messa } internal readonly AsyncEvent, ISocketMessageChannel, Task>> _messageDeletedEvent = new AsyncEvent, ISocketMessageChannel, Task>>(); /// Fired when a message is updated. + /// + /// + /// This event is fired when a message is updated. The event handler must return a + /// and accept a , , + /// and as its parameters. + /// + /// + /// If caching is enabled via , the + /// entity will contain the original message; otherwise, in event + /// that the message cannot be retrieved, the snowflake ID of the message is preserved in the + /// . + /// + /// + /// The updated message will be passed into the parameter. + /// + /// + /// The source channel of the updated message will be passed into the + /// parameter. + /// + /// public event Func, SocketMessage, ISocketMessageChannel, Task> MessageUpdated { add { _messageUpdatedEvent.Add(value); } remove { _messageUpdatedEvent.Remove(value); }