Get docs working on latest docfx version. (#2778)

* [Docs] Get docs working on latest docfx version.

Removed light-dark-theme as it didn't work with modern docfx, and Material provides the features it provided anyways.

Gotta figure out how to get the description generator and "last modified" plugins to work.

* [Docs] Get docs working on latest docfx version.

Removed light-dark-theme as it didn't work with modern docfx, and Material provides the features it provided anyways.

Gotta figure out how to get the description generator and "last modified" plugins to work.

* [Docs] Re-add search index extractor.

* [Docs] Use material theme and override derived tree style.

Also adds a tiny GitHub icon on the navbar.

* [Docs] Exclude DebugTools project.

* [Docs] Use better method for overriding things.

Totally not because DocFX won't allow me to have an override template.

* [Docs] Improve styling overrides.

* [Docs] Fix links in FAQs and guides.

* [Docs] Use new xref service.

The old xref service is being deprecated by the end of the year.
See https://github.com/dotnet/docfx/issues/8958

* [Docs] Replace (c) with proper copyright symbol.

* [Docs] Fix formatting in docfx.json file.

Thanks, VSCode.

* [Docs] Remove non-working post processors.

They don't work, and *personally* I feel like they're unnecessary considering you can check the last modification date in the (linked) GitHub page. I honestly have no idea what the other post processor does and honestly the code doesn't help much either.

* [Docs] Fix "in this article" being too thin.

Fixes https://github.com/discord-net/Discord.Net/pull/2778#issuecomment-1748812077

* [Docs] Get examples working again.

* [Docs] Make properties be separated more clearly.

* [Docs] Change docs index to reflect the new nightly MyGet feed.

* [Docs] Get docs working on latest docfx version.

Removed light-dark-theme as it didn't work with modern docfx, and Material provides the features it provided anyways.

Gotta figure out how to get the description generator and "last modified" plugins to work.

* [Docs] Get docs working on latest docfx version.

Removed light-dark-theme as it didn't work with modern docfx, and Material provides the features it provided anyways.

Gotta figure out how to get the description generator and "last modified" plugins to work.

* [Docs] Re-add search index extractor.

* [Docs] Use material theme and override derived tree style.

Also adds a tiny GitHub icon on the navbar.

* [Docs] Exclude DebugTools project.

* [Docs] Use better method for overriding things.

Totally not because DocFX won't allow me to have an override template.

* [Docs] Improve styling overrides.

* [Docs] Fix links in FAQs and guides.

* [Docs] Use new xref service.

The old xref service is being deprecated by the end of the year.
See https://github.com/dotnet/docfx/issues/8958

* [Docs] Replace (c) with proper copyright symbol.

* [Docs] Fix formatting in docfx.json file.

Thanks, VSCode.

* [Docs] Remove non-working post processors.

They don't work, and *personally* I feel like they're unnecessary considering you can check the last modification date in the (linked) GitHub page. I honestly have no idea what the other post processor does and honestly the code doesn't help much either.

* [Docs] Fix "in this article" being too thin.

Fixes https://github.com/discord-net/Discord.Net/pull/2778#issuecomment-1748812077

* [Docs] Get examples working again.

* [Docs] Make properties be separated more clearly.

* [Docs] Change docs index to reflect the new nightly MyGet feed.

* [Docs] Fix index image not switching when changing themes.

Co-Authored-By: exsersewo <25526843+exsersewo@users.noreply.github.com>

* add updated description generator postprocessor

* update postprocessor

* got it working

* downgrade postprocessor docfx

* [Docs] Add left margin to side navigation links.

* remove dup docs cuz `<inheritdoc />`

---------

Co-authored-by: exsersewo <25526843+exsersewo@users.noreply.github.com>
Co-authored-by: Misha133 <mihagribkov133@gmail.com>
Co-authored-by: Mihail Gribkov <61027276+Misha-133@users.noreply.github.com>
This commit is contained in:
Nora
2024-02-11 19:51:10 +01:00
committed by GitHub
parent 89efe0f3ad
commit dc8e0e329d
65 changed files with 286 additions and 2651 deletions

View File

@@ -108,12 +108,12 @@ namespace Discord
/// Adds or updates the permission overwrite for the given role.
/// </summary>
/// <example>
/// <para>The following example fetches a role via <see cref="IGuild.GetRole"/> and a channel via
/// <see cref="IGuild.GetChannelAsync"/>. Next, it checks if an overwrite had already been set via
/// <para>The following example fetches a role via <see cref="IGuild.GetRole"/> and a channel via
/// <see cref="IGuild.GetChannelAsync"/>. Next, it checks if an overwrite had already been set via
/// <see cref="GetPermissionOverwrite(Discord.IRole)"/>; if not, it denies the role from sending any
/// messages to the channel.</para>
/// <code language="cs" region="AddPermissionOverwriteAsyncRole"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IGuildChannel.Examples.cs"/>
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IGuildChannel.Examples.cs"/>
/// </example>
/// <param name="role">The role to add the overwrite to.</param>
/// <param name="permissions">The overwrite to add to the role.</param>
@@ -127,12 +127,12 @@ namespace Discord
/// Adds or updates the permission overwrite for the given user.
/// </summary>
/// <example>
/// <para>The following example fetches a user via <see cref="IGuild.GetUserAsync"/> and a channel via
/// <see cref="IGuild.GetChannelAsync"/>. Next, it checks if an overwrite had already been set via
/// <para>The following example fetches a user via <see cref="IGuild.GetUserAsync"/> and a channel via
/// <see cref="IGuild.GetChannelAsync"/>. Next, it checks if an overwrite had already been set via
/// <see cref="GetPermissionOverwrite(Discord.IUser)"/>; if not, it denies the user from sending any
/// messages to the channel.</para>
/// <code language="cs" region="AddPermissionOverwriteAsyncUser"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IGuildChannel.Examples.cs"/>
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IGuildChannel.Examples.cs"/>
/// </example>
/// <param name="user">The user to add the overwrite to.</param>
/// <param name="permissions">The overwrite to add to the user.</param>

View File

@@ -17,7 +17,7 @@ namespace Discord
/// <para>The following example sends a message with the current system time in RFC 1123 format to the channel and
/// deletes itself after 5 seconds.</para>
/// <code language="cs" region="SendMessageAsync"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <param name="text">The message to be sent.</param>
/// <param name="isTTS">Determines whether the message should be read aloud by Discord or not.</param>
@@ -42,14 +42,14 @@ namespace Discord
/// Sends a file to this message channel with an optional caption.
/// </summary>
/// <example>
/// <para>The following example uploads a local file called <c>wumpus.txt</c> along with the text
/// <para>The following example uploads a local file called <c>wumpus.txt</c> along with the text
/// <c>good discord boi</c> to the channel.</para>
/// <code language="cs" region="SendFileAsync.FilePath"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// <para>The following example uploads a local image called <c>b1nzy.jpg</c> embedded inside a rich embed to the
/// channel.</para>
/// <code language="cs" region="SendFileAsync.FilePath.EmbeddedImage"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <remarks>
/// This method sends a file as if you are uploading an attachment directly from your Discord client.
@@ -86,7 +86,7 @@ namespace Discord
/// <para>The following example uploads a streamed image that will be called <c>b1nzy.jpg</c> embedded inside a
/// rich embed to the channel.</para>
/// <code language="cs" region="SendFileAsync.FileStream.EmbeddedImage"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <remarks>
/// This method sends a file as if you are uploading an attachment directly from your Discord client.
@@ -195,7 +195,7 @@ namespace Discord
/// </summary>
/// <remarks>
/// <note type="important">
/// The returned collection is an asynchronous enumerable object; one must call
/// The returned collection is an asynchronous enumerable object; one must call
/// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual messages as a
/// collection.
/// </note>
@@ -204,17 +204,17 @@ namespace Discord
/// rate limit, causing your bot to freeze!
/// </note>
/// This method will attempt to fetch the number of messages specified under <paramref name="limit"/>. The
/// library will attempt to split up the requests according to your <paramref name="limit"/> and
/// library will attempt to split up the requests according to your <paramref name="limit"/> and
/// <see cref="DiscordConfig.MaxMessagesPerBatch"/>. In other words, should the user request 500 messages,
/// and the <see cref="Discord.DiscordConfig.MaxMessagesPerBatch"/> constant is <c>100</c>, the request will
/// be split into 5 individual requests; thus returning 5 individual asynchronous responses, hence the need
/// of flattening.
/// </remarks>
/// <example>
/// <para>The following example downloads 300 messages and gets messages that belong to the user
/// <para>The following example downloads 300 messages and gets messages that belong to the user
/// <c>53905483156684800</c>.</para>
/// <code language="cs" region="GetMessagesAsync.FromLimit.Standard"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <param name="limit">The numbers of message to be gotten from.</param>
/// <param name="mode">The <see cref="CacheMode" /> that determines whether the object should be fetched from
@@ -230,7 +230,7 @@ namespace Discord
/// </summary>
/// <remarks>
/// <note type="important">
/// The returned collection is an asynchronous enumerable object; one must call
/// The returned collection is an asynchronous enumerable object; one must call
/// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual messages as a
/// collection.
/// </note>
@@ -240,7 +240,7 @@ namespace Discord
/// </note>
/// This method will attempt to fetch the number of messages specified under <paramref name="limit"/> around
/// the message <paramref name="fromMessageId"/> depending on the <paramref name="dir"/>. The library will
/// attempt to split up the requests according to your <paramref name="limit"/> and
/// attempt to split up the requests according to your <paramref name="limit"/> and
/// <see cref="DiscordConfig.MaxMessagesPerBatch"/>. In other words, should the user request 500 messages,
/// and the <see cref="Discord.DiscordConfig.MaxMessagesPerBatch"/> constant is <c>100</c>, the request will
/// be split into 5 individual requests; thus returning 5 individual asynchronous responses, hence the need
@@ -249,11 +249,11 @@ namespace Discord
/// <example>
/// <para>The following example gets 5 message prior to the message identifier <c>442012544660537354</c>.</para>
/// <code language="cs" region="GetMessagesAsync.FromId.FromMessage"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// <para>The following example attempts to retrieve <c>messageCount</c> number of messages from the
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// <para>The following example attempts to retrieve <c>messageCount</c> number of messages from the
/// beginning of the channel and prints them to the console.</para>
/// <code language="cs" region="GetMessagesAsync.FromId.BeginningMessages"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <param name="fromMessageId">The ID of the starting message to get the messages from.</param>
/// <param name="dir">The direction of the messages to be gotten from.</param>
@@ -271,7 +271,7 @@ namespace Discord
/// </summary>
/// <remarks>
/// <note type="important">
/// The returned collection is an asynchronous enumerable object; one must call
/// The returned collection is an asynchronous enumerable object; one must call
/// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual messages as a
/// collection.
/// </note>
@@ -281,7 +281,7 @@ namespace Discord
/// </note>
/// This method will attempt to fetch the number of messages specified under <paramref name="limit"/> around
/// the message <paramref name="fromMessage"/> depending on the <paramref name="dir"/>. The library will
/// attempt to split up the requests according to your <paramref name="limit"/> and
/// attempt to split up the requests according to your <paramref name="limit"/> and
/// <see cref="DiscordConfig.MaxMessagesPerBatch"/>. In other words, should the user request 500 messages,
/// and the <see cref="Discord.DiscordConfig.MaxMessagesPerBatch"/> constant is <c>100</c>, the request will
/// be split into 5 individual requests; thus returning 5 individual asynchronous responses, hence the need
@@ -290,7 +290,7 @@ namespace Discord
/// <example>
/// <para>The following example gets 5 message prior to a specific message, <c>oldMessage</c>.</para>
/// <code language="cs" region="GetMessagesAsync.FromMessage"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <param name="fromMessage">The starting message to get the messages from.</param>
/// <param name="dir">The direction of the messages to be gotten from.</param>
@@ -360,7 +360,7 @@ namespace Discord
/// <example>
/// <para>The following example keeps the client in the typing state until <c>LongRunningAsync</c> has finished.</para>
/// <code language="cs" region="EnterTypingState"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Channels\IMessageChannel.Examples.cs" />
/// source="../../../Discord.Net.Examples/Core/Entities/Channels/IMessageChannel.Examples.cs" />
/// </example>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>

View File

@@ -790,7 +790,7 @@ namespace Discord
/// <example>
/// <para>The following example creates a new text channel under an existing category named <c>Wumpus</c> with a set topic.</para>
/// <code language="cs" region="CreateTextChannelAsync"
/// source="..\..\..\Discord.Net.Examples\Core\Entities\Guilds\IGuild.Examples.cs"/>
/// source="../../../Discord.Net.Examples/Core/Entities/Guilds/IGuild.Examples.cs"/>
/// </example>
/// <param name="name">The new name for the text channel.</param>
/// <param name="func">The delegate containing the properties to be applied to the channel upon its creation.</param>

View File

@@ -19,6 +19,13 @@ namespace Discord
/// If you wish to retrieve the display avatar for this user, consider using <see cref="GetDisplayAvatarUrl"/>.
/// </note>
/// </remarks>
/// <example>
/// <para
/// >The following example attempts to retrieve the user's current avatar and send it to a channel; if one is
/// not set, a default avatar for this user will be returned instead.</para>
/// <code language="cs" region="GetAvatarUrl"
/// source="../../../Discord.Net.Examples/Core/Entities/Users/IUser.Examples.cs"/>
/// </example>
/// <param name="format">The format of the image.</param>
/// <param name="size">The size of the image that matches any power of two, ranging from 16 to 2048.</param>
/// <returns>

View File

@@ -959,25 +959,6 @@ namespace Discord.Rest
=> GuildHelper.GetUserAsync(this, Discord, OwnerId, options);
/// <inheritdoc />
/// <summary>
/// Prunes inactive users.
/// </summary>
/// <remarks>
/// <para>
/// This method removes all users that have not logged on in the provided number of <paramref name="days"/>.
/// </para>
/// <para>
/// If <paramref name="simulate" /> is <see langword="true" />, this method will only return the number of users that
/// would be removed without kicking the users.
/// </para>
/// </remarks>
/// <param name="days">The number of days required for the users to be kicked.</param>
/// <param name="simulate">Whether this prune action is a simulation.</param>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>
/// A task that represents the asynchronous prune operation. The task result contains the number of users to
/// be or has been removed from this guild.
/// </returns>
public Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null, IEnumerable<ulong> includeRoleIds = null)
=> GuildHelper.PruneUsersAsync(this, Discord, days, simulate, options, includeRoleIds);

View File

@@ -23,7 +23,7 @@ namespace Discord.WebSocket
/// </remarks>
/// <example>
/// <code language="cs" region="ChannelCreated"
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
/// source="../Discord.Net.Examples/WebSocket/BaseSocketClient.Events.Examples.cs"/>
/// </example>
public event Func<SocketChannel, Task> ChannelCreated
{
@@ -45,7 +45,7 @@ namespace Discord.WebSocket
/// </remarks>
/// <example>
/// <code language="cs" region="ChannelDestroyed"
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
/// source="../Discord.Net.Examples/WebSocket/BaseSocketClient.Events.Examples.cs"/>
/// </example>
public event Func<SocketChannel, Task> ChannelDestroyed
{
@@ -68,7 +68,7 @@ namespace Discord.WebSocket
/// </remarks>
/// <example>
/// <code language="cs" region="ChannelUpdated"
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
/// source="../Discord.Net.Examples/WebSocket/BaseSocketClient.Events.Examples.cs"/>
/// </example>
public event Func<SocketChannel, SocketChannel, Task> ChannelUpdated
{
@@ -111,7 +111,7 @@ namespace Discord.WebSocket
/// <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"/>
/// source="../Discord.Net.Examples/WebSocket/BaseSocketClient.Events.Examples.cs"/>
/// </example>
public event Func<SocketMessage, Task> MessageReceived
{
@@ -144,7 +144,7 @@ namespace Discord.WebSocket
/// </remarks>
/// <example>
/// <code language="cs" region="MessageDeleted"
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs" />
/// source="../Discord.Net.Examples/WebSocket/BaseSocketClient.Events.Examples.cs" />
/// </example>
public event Func<Cacheable<IMessage, ulong>, Cacheable<IMessageChannel, ulong>, Task> MessageDeleted
@@ -240,7 +240,7 @@ namespace Discord.WebSocket
/// </remarks>
/// <example>
/// <code language="cs" region="ReactionAdded"
/// source="..\Discord.Net.Examples\WebSocket\BaseSocketClient.Events.Examples.cs"/>
/// source="../Discord.Net.Examples/WebSocket/BaseSocketClient.Events.Examples.cs"/>
/// </example>
public event Func<Cacheable<IUserMessage, ulong>, Cacheable<IMessageChannel, ulong>, SocketReaction, Task> ReactionAdded
{