docs: Main docs update (#1304)
* Remove template in favor of official samples * Fixed a variable name copy pasta mistake line 35 was _database.GetData() instead of DBService.GetData() * Experimental theme change * Change paragraph, code, heading fonts * Widen viewport * Update DocFX.Plugins.LastModified v1.2.3 * Exclude Discord.API in docs * Add remarks for SocketReaction properties * Add examples for BaseSocketClient.Events * Add additional clarification for some methods * Move IUser and IGuildChannel examples * Clarify several guides samples with notes - Reword TypeReader comment to avoid giving the idea that the sample itself is "obsolete" - Remove CommandException logging comment regarding C#7.0 as the version is now the standard across VS2017 and up - Remove suggestion about handling result in command handler since it is now advised to use CommandExecuted instead + Add additional comment to clarify ctor for DI setup * Add/migrate code examples * Incorporate material design theme License @ https://github.com/ovasquez * Update installation and nightly guide * Fix improper indentations made obvious by the widen viewport * Fix minor grammar issues + Add installation for nightly build using dotnet CLI * Fix nav level indentation * Revise "Your First Bot" article * Merge some paragraphs to avoid clutter while keeping readability * Reword the use of command framework + Add additional warning/note about environment variable * Add additional indent level * Fix indentation text warping * Remove connections sample * Update logging sample Remove redundant part of the sample * Remove mention of RPC * Remove misleading section about commands - Remove command sample from complete snippet * Revise "Your First Bot" command paragraphs * Change wording to hint devs that additional command parser packages may be available, as more and more begin to crop up * Update themes * Add XML docs contribution guidelines Update guidelines * Update CommandExecuted remarks * Fix precondition remarks typo no one saw that ok * Fix permission sample in docfx * Fix IMessageChannel samples * Update docs/_template/light-dark-theme/styles/docfx.vendor.minify.css Co-Authored-By: Still34 <341464@gmail.com> * Update docs/_template/light-dark-theme/styles/material.css Co-Authored-By: Still34 <341464@gmail.com> * Update docs/_template/light-dark-theme/styles/material.css Co-Authored-By: Still34 <341464@gmail.com>
This commit is contained in:
@@ -18,6 +18,10 @@ namespace Discord.WebSocket
|
||||
/// see the derived classes of <see cref="SocketChannel"/> for more details.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code language="cs" region="ChannelCreated"
|
||||
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
|
||||
/// </example>
|
||||
public event Func<SocketChannel, Task> ChannelCreated
|
||||
{
|
||||
add { _channelCreatedEvent.Add(value); }
|
||||
@@ -36,6 +40,10 @@ namespace Discord.WebSocket
|
||||
/// see the derived classes of <see cref="SocketChannel"/> for more details.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code language="cs" region="ChannelDestroyed"
|
||||
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
|
||||
/// </example>
|
||||
public event Func<SocketChannel, Task> ChannelDestroyed {
|
||||
add { _channelDestroyedEvent.Add(value); }
|
||||
remove { _channelDestroyedEvent.Remove(value); }
|
||||
@@ -54,6 +62,10 @@ namespace Discord.WebSocket
|
||||
/// <see cref="SocketChannel"/> for more details.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code language="cs" region="ChannelUpdated"
|
||||
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
|
||||
/// </example>
|
||||
public event Func<SocketChannel, SocketChannel, Task> ChannelUpdated {
|
||||
add { _channelUpdatedEvent.Add(value); }
|
||||
remove { _channelUpdatedEvent.Remove(value); }
|
||||
@@ -74,6 +86,11 @@ namespace Discord.WebSocket
|
||||
/// derived classes of <see cref="SocketMessage"/> for more details.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <para>The example below checks if the newly received message contains the target user.</para>
|
||||
/// <code language="cs" region="MessageReceived"
|
||||
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
|
||||
/// </example>
|
||||
public event Func<SocketMessage, Task> MessageReceived {
|
||||
add { _messageReceivedEvent.Add(value); }
|
||||
remove { _messageReceivedEvent.Remove(value); }
|
||||
@@ -102,6 +119,10 @@ namespace Discord.WebSocket
|
||||
/// <see cref="ISocketMessageChannel"/> parameter.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code language="cs" region="MessageDeleted"
|
||||
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs" />
|
||||
/// </example>
|
||||
public event Func<Cacheable<IMessage, ulong>, ISocketMessageChannel, Task> MessageDeleted {
|
||||
add { _messageDeletedEvent.Add(value); }
|
||||
remove { _messageDeletedEvent.Remove(value); }
|
||||
@@ -134,6 +155,35 @@ namespace Discord.WebSocket
|
||||
}
|
||||
internal readonly AsyncEvent<Func<Cacheable<IMessage, ulong>, SocketMessage, ISocketMessageChannel, Task>> _messageUpdatedEvent = new AsyncEvent<Func<Cacheable<IMessage, ulong>, SocketMessage, ISocketMessageChannel, Task>>();
|
||||
/// <summary> Fired when a reaction is added to a message. </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This event is fired when a reaction is added to a user message. The event handler must return a
|
||||
/// <see cref="Task"/> and accept a <see cref="Cacheable{TEntity,TId}"/>, an
|
||||
/// <see cref="ISocketMessageChannel"/>, and a <see cref="SocketReaction"/> as its parameter.
|
||||
/// </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 source channel of the reaction addition will be passed into the
|
||||
/// <see cref="ISocketMessageChannel"/> parameter.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The reaction that was added will be passed into the <see cref="SocketReaction"/> parameter.
|
||||
/// </para>
|
||||
/// <note>
|
||||
/// When fetching the reaction from this event, a user may not be provided under
|
||||
/// <see cref="SocketReaction.User"/>. Please see the documentation of the property for more
|
||||
/// information.
|
||||
/// </note>
|
||||
/// </remarks>
|
||||
/// <example>
|
||||
/// <code language="cs" region="ReactionAdded"
|
||||
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
|
||||
/// </example>
|
||||
public event Func<Cacheable<IUserMessage, ulong>, ISocketMessageChannel, SocketReaction, Task> ReactionAdded {
|
||||
add { _reactionAddedEvent.Add(value); }
|
||||
remove { _reactionAddedEvent.Remove(value); }
|
||||
|
||||
Reference in New Issue
Block a user