Skip to content

Commit

Permalink
Add documentation for new API version & few events
Browse files Browse the repository at this point in the history
  • Loading branch information
Still Hsu committed May 29, 2018
1 parent f4fb027 commit 17a4af7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/Discord.Net.Core/DiscordConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@ public class DiscordConfig
/// Returns the API version Discord.Net uses.
/// </summary>
/// <returns>
/// A 32-bit integer representing the API version that Discord.Net uses to communicate with Discord.
/// An <see cref="int"/> representing the API version that Discord.Net uses to communicate with Discord.
/// <para>A list of available API version can be seen on the official
/// <see href="https://discordapp.com/developers/docs/reference#api-versioning">Discord API documentation</see>
/// .</para>
/// </returns>
public const int APIVersion = 6;
/// <summary>
/// Returns the Voice API version Discord.Net uses.
/// </summary>
/// <returns>
/// An <see cref="int"/> representing the API version that Discord.Net uses to communicate with Discord's
/// voice server.
/// </returns>
public const int VoiceAPIVersion = 3;
/// <summary>
/// Gets the Discord.Net version, including the build number.
Expand Down
32 changes: 26 additions & 6 deletions src/Discord.Net.WebSocket/BaseSocketClient.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class BaseSocketClient
/// <remarks>
/// <para>
/// This event is fired when a generic channel has been created. The event handler must return a
/// <see cref="Task"/>.
/// <see cref="Task"/> and accept a <see cref="SocketChannel"/> as its parameter.
/// </para>
/// <para>
/// The newly created channel is passed into the event handler parameter. The given channel type may
Expand All @@ -28,7 +28,7 @@ public event Func<SocketChannel, Task> ChannelCreated
/// <remarks>
/// <para>
/// This event is fired when a generic channel has been destroyed. The event handler must return a
/// <see cref="Task"/>.
/// <see cref="Task"/> and accept a <see cref="SocketChannel"/> as its parameter.
/// </para>
/// <para>
/// The destroyed channel is passed into the event handler parameter. The given channel type may
Expand All @@ -45,7 +45,7 @@ public event Func<SocketChannel, Task> ChannelDestroyed {
/// <remarks>
/// <para>
/// This event is fired when a generic channel has been destroyed. The event handler must return a
/// <see cref="Task"/>.
/// <see cref="Task"/> and accept 2 <see cref="SocketChannel"/> as its parameters.
/// </para>
/// <para>
/// The original (prior to update) channel is passed into the first <see cref="SocketChannel"/>, while
Expand All @@ -65,13 +65,13 @@ public event Func<SocketChannel, SocketChannel, Task> ChannelUpdated {
/// <remarks>
/// <para>
/// This event is fired when a message is received. The event handler must return a
/// <see cref="Task"/>.
/// <see cref="Task"/> and accept a <see cref="SocketMessage"/> as its parameter.
/// </para>
/// <para>
/// The message that is sent to the client is passed into the event handler parameter as
/// <see cref="SocketMessage"/>. This message may be a system message (i.e.
/// <see cref="SocketSystemMessage"/>) or a user message (i.e. <see cref="SocketUserMessage"/>. See
/// the derived clsases of <see cref="SocketMessage"/> for more details.
/// <see cref="SocketSystemMessage"/>) or a user message (i.e. <see cref="SocketUserMessage"/>. See the
/// derived clsases of <see cref="SocketMessage"/> for more details.
/// </para>
/// </remarks>
public event Func<SocketMessage, Task> MessageReceived {
Expand Down Expand Up @@ -108,6 +108,26 @@ public event Func<Cacheable<IMessage, ulong>, ISocketMessageChannel, Task> Messa
}
internal readonly AsyncEvent<Func<Cacheable<IMessage, ulong>, ISocketMessageChannel, Task>> _messageDeletedEvent = new AsyncEvent<Func<Cacheable<IMessage, ulong>, ISocketMessageChannel, Task>>();
/// <summary> Fired when a message is updated. </summary>
/// <remarks>
/// <para>
/// This event is fired when a message is updated. The event handler must return a
/// <see cref="Task"/> and accept a <see cref="Cacheable{TEntity,TId}"/>, <see cref="SocketMessage"/>,
/// and <see cref="ISocketMessageChannel"/> as its parameters.
/// </para>
/// <para>
/// If caching is enabled via <see cref="DiscordSocketConfig"/>, the
/// <see cref="Cacheable{TEntity,TId}"/> 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
/// <see cref="ulong"/>.
/// </para>
/// <para>
/// The updated message will be passed into the <see cref="SocketMessage"/> parameter.
/// </para>
/// <para>
/// The source channel of the updated message will be passed into the
/// <see cref="ISocketMessageChannel"/> parameter.
/// </para>
/// </remarks>
public event Func<Cacheable<IMessage, ulong>, SocketMessage, ISocketMessageChannel, Task> MessageUpdated {
add { _messageUpdatedEvent.Add(value); }
remove { _messageUpdatedEvent.Remove(value); }
Expand Down

0 comments on commit 17a4af7

Please sign in to comment.