Browse Source

Fixed some warnings (#184)

* Fixed some warnings

* Another fixed warning

* Changed the SSendFileAsync to SendFileAsync

* Removed para AlwaysAcknowledgeInteractions

* Moved it back to the previous version

* Added periods to the end like quin requested!! :((

Co-authored-by: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>
pull/1923/head
Simon Hjorthøj GitHub 3 years ago
parent
commit
c997ac2779
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 192 additions and 186 deletions
  1. +4
    -2
      src/Discord.Net.Commands/Discord.Net.Commands.xml
  2. +2
    -2
      src/Discord.Net.Commands/ModuleBase.cs
  3. +1
    -1
      src/Discord.Net.Core/CDN.cs
  4. +38
    -32
      src/Discord.Net.Core/Discord.Net.Core.xml
  5. +4
    -4
      src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
  6. +2
    -2
      src/Discord.Net.Core/Entities/Channels/INestedChannel.cs
  7. +1
    -1
      src/Discord.Net.Core/Entities/Channels/IStageChannel.cs
  8. +1
    -1
      src/Discord.Net.Core/Entities/Guilds/IGuild.cs
  9. +1
    -1
      src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOption.cs
  10. +5
    -5
      src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs
  11. +11
    -11
      src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs
  12. +1
    -0
      src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs
  13. +1
    -1
      src/Discord.Net.Core/Entities/Users/IGuildUser.cs
  14. +7
    -3
      src/Discord.Net.Core/Extensions/MessageExtensions.cs
  15. +4
    -2
      src/Discord.Net.Core/Extensions/UserExtensions.cs
  16. +0
    -4
      src/Discord.Net.Core/Net/ApplicationCommandException.cs
  17. +1
    -1
      src/Discord.Net.Core/Utils/UrlValidation.cs
  18. +5
    -5
      src/Discord.Net.Rest/Discord.Net.Rest.xml
  19. +4
    -4
      src/Discord.Net.Rest/Entities/Channels/IRestMessageChannel.cs
  20. +1
    -2
      src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs
  21. +1
    -1
      src/Discord.Net.WebSocket/API/Gateway/ExtendedGuild.cs
  22. +20
    -20
      src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml
  23. +4
    -4
      src/Discord.Net.WebSocket/Entities/Channels/ISocketMessageChannel.cs
  24. +3
    -3
      src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs
  25. +15
    -19
      src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs
  26. +5
    -5
      test/Discord.Net.Analyzers.Tests/Helpers/CodeFixVerifier.Helper.cs
  27. +12
    -12
      test/Discord.Net.Analyzers.Tests/Helpers/DiagnosticVerifier.Helper.cs
  28. +17
    -17
      test/Discord.Net.Analyzers.Tests/Verifiers/CodeFixVerifier.cs
  29. +21
    -21
      test/Discord.Net.Analyzers.Tests/Verifiers/DiagnosticVerifier.cs

+ 4
- 2
src/Discord.Net.Commands/Discord.Net.Commands.xml View File

@@ -1138,13 +1138,15 @@
</param> </param>
<param name="isTTS">Specifies if Discord should read this <paramref name="message"/> aloud using text-to-speech.</param> <param name="isTTS">Specifies if Discord should read this <paramref name="message"/> aloud using text-to-speech.</param>
<param name="embed">An embed to be displayed alongside the <paramref name="message"/>.</param> <param name="embed">An embed to be displayed alongside the <paramref name="message"/>.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10</param> /// <param name="allowedMentions">
<param name="allowedMentions">
Specifies if notifications are sent for mentioned users and roles in the <paramref name="message"/>. Specifies if notifications are sent for mentioned users and roles in the <paramref name="message"/>.
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="options">The request options for this async request.</param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the file.</param> <param name="stickers">A collection of stickers to send with the file.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10.</param>
</member> </member>
<member name="M:Discord.Commands.ModuleBase`1.BeforeExecute(Discord.Commands.CommandInfo)"> <member name="M:Discord.Commands.ModuleBase`1.BeforeExecute(Discord.Commands.CommandInfo)">
<summary> <summary>


+ 2
- 2
src/Discord.Net.Commands/ModuleBase.cs View File

@@ -38,9 +38,9 @@ namespace Discord.Commands
/// </param> /// </param>
/// <param name="options">The request options for this async request.</param> /// <param name="options">The request options for this async request.</param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param> /// <param name="stickers">A collection of stickers to send with the file.</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param>
protected virtual async Task<IUserMessage> ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null) protected virtual async Task<IUserMessage> ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null, MessageComponent component = null, ISticker[] stickers = null, Embed[] embeds = null)
{ {
return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions, messageReference, component, stickers, embeds).ConfigureAwait(false); return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions, messageReference, component, stickers, embeds).ConfigureAwait(false);


+ 1
- 1
src/Discord.Net.Core/CDN.cs View File

@@ -181,7 +181,7 @@ namespace Discord
/// Gets a stickers url based off the id and format. /// Gets a stickers url based off the id and format.
/// </summary> /// </summary>
/// <param name="stickerId">The id of the sticker.</param> /// <param name="stickerId">The id of the sticker.</param>
/// <param name="format">The format of the sticker</param>
/// <param name="format">The format of the sticker.</param>
/// <returns> /// <returns>
/// A URL to the sticker. /// A URL to the sticker.
/// </returns> /// </returns>


+ 38
- 32
src/Discord.Net.Core/Discord.Net.Core.xml View File

@@ -217,7 +217,7 @@
Gets a stickers url based off the id and format. Gets a stickers url based off the id and format.
</summary> </summary>
<param name="stickerId">The id of the sticker.</param> <param name="stickerId">The id of the sticker.</param>
<param name="format">The format of the sticker</param>
<param name="format">The format of the sticker.</param>
<returns> <returns>
A URL to the sticker. A URL to the sticker.
</returns> </returns>
@@ -1526,9 +1526,9 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the message.</param> <param name="stickers">A collection of stickers to send with the message.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message. contains the sent message.
@@ -1567,7 +1567,7 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the file.</param> <param name="stickers">A collection of stickers to send with the file.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
@@ -1604,7 +1604,7 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the file.</param> <param name="stickers">A collection of stickers to send with the file.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
@@ -1870,7 +1870,7 @@
await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3); await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3);
</code> </code>
</example> </example>
<param name="applicationId">The id of the embedded application to open for this invite</param>
<param name="applicationId">The id of the embedded application to open for this invite.</param>
<param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param> <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param>
<param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param> <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param>
<param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param> <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param>
@@ -1892,7 +1892,7 @@
await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3); await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3);
</code> </code>
</example> </example>
<param name="user">The id of the user whose stream to display for this invite</param>
<param name="user">The id of the user whose stream to display for this invite.</param>
<param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param> <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param>
<param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param> <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param>
<param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param> <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param>
@@ -1979,7 +1979,7 @@
Starts the stage, creating a stage instance. Starts the stage, creating a stage instance.
</summary> </summary>
<param name="topic">The topic for the stage/</param> <param name="topic">The topic for the stage/</param>
<param name="privacyLevel">The privacy level of the stage</param>
<param name="privacyLevel">The privacy level of the stage.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<returns> <returns>
A task that represents the asynchronous start operation. A task that represents the asynchronous start operation.
@@ -3996,7 +3996,7 @@
<param name="description">The description of the sticker.</param> <param name="description">The description of the sticker.</param>
<param name="tags">The tags of the sticker.</param> <param name="tags">The tags of the sticker.</param>
<param name="stream">The stream containing the file data.</param> <param name="stream">The stream containing the file data.</param>
<param name="filename">The name of the file <b>with</b> the extension, ex: image.png</param>
<param name="filename">The name of the file <b>with</b> the extension, ex: image.png.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<returns> <returns>
A task that represents the asynchronous creation operation. The task result contains the created sticker. A task that represents the asynchronous creation operation. The task result contains the created sticker.
@@ -5007,25 +5007,25 @@
Responds to an Interaction with type <see cref="F:Discord.InteractionResponseType.ChannelMessageWithSource"/>. Responds to an Interaction with type <see cref="F:Discord.InteractionResponseType.ChannelMessageWithSource"/>.
</summary> </summary>
<param name="text">The text of the message to be sent.</param> <param name="text">The text of the message to be sent.</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="embeds">A array of embeds to send with this response. Max 10.</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param> <param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param> <param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response.</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
</member> </member>
<member name="M:Discord.IDiscordInteraction.FollowupAsync(System.String,Discord.Embed[],System.Boolean,System.Boolean,Discord.AllowedMentions,Discord.RequestOptions,Discord.MessageComponent,Discord.Embed)"> <member name="M:Discord.IDiscordInteraction.FollowupAsync(System.String,Discord.Embed[],System.Boolean,System.Boolean,Discord.AllowedMentions,Discord.RequestOptions,Discord.MessageComponent,Discord.Embed)">
<summary> <summary>
Sends a followup message for this interaction. Sends a followup message for this interaction.
</summary> </summary>
<param name="text">The text of the message to be sent</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="text">The text of the message to be sent.</param>
<param name="embeds">A array of embeds to send with this response. Max 10.</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param> <param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param> <param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response.</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
<returns> <returns>
The sent message. The sent message.
@@ -5414,10 +5414,10 @@
</summary> </summary>
<param name="label">The label to use on the newly created link button.</param> <param name="label">The label to use on the newly created link button.</param>
<param name="url">The url of this button.</param> <param name="url">The url of this button.</param>
<param name="customId">The custom ID of this button</param>
<param name="style">The custom ID of this button</param>
<param name="emote">The emote of this button</param>
<param name="disabled">Disabled this button or not</param>
<param name="customId">The custom ID of this button.</param>
<param name="style">The custom ID of this button.</param>
<param name="emote">The emote of this button.</param>
<param name="disabled">Disabled this button or not.</param>
</member> </member>
<member name="M:Discord.ButtonBuilder.#ctor(Discord.ButtonComponent)"> <member name="M:Discord.ButtonBuilder.#ctor(Discord.ButtonComponent)">
<summary> <summary>
@@ -5430,7 +5430,7 @@
</summary> </summary>
<param name="label">The label for this link button.</param> <param name="label">The label for this link button.</param>
<param name="url">The url for this link button to go to.</param> <param name="url">The url for this link button to go to.</param>
<param name="emote">The emote for this link button</param>
<param name="emote">The emote for this link button.</param>
<returns>A builder with the newly created button.</returns> <returns>A builder with the newly created button.</returns>
</member> </member>
<member name="M:Discord.ButtonBuilder.CreateDangerButton(System.String,System.String,Discord.IEmote)"> <member name="M:Discord.ButtonBuilder.CreateDangerButton(System.String,System.String,Discord.IEmote)">
@@ -5439,7 +5439,7 @@
</summary> </summary>
<param name="label">The label for this danger button.</param> <param name="label">The label for this danger button.</param>
<param name="customId">The custom id for this danger button.</param> <param name="customId">The custom id for this danger button.</param>
<param name="emote">The emote for this danger button</param>
<param name="emote">The emote for this danger button.</param>
<returns>A builder with the newly created button.</returns> <returns>A builder with the newly created button.</returns>
</member> </member>
<member name="M:Discord.ButtonBuilder.CreatePrimaryButton(System.String,System.String,Discord.IEmote)"> <member name="M:Discord.ButtonBuilder.CreatePrimaryButton(System.String,System.String,Discord.IEmote)">
@@ -5448,7 +5448,7 @@
</summary> </summary>
<param name="label">The label for this primary button.</param> <param name="label">The label for this primary button.</param>
<param name="customId">The custom id for this primary button.</param> <param name="customId">The custom id for this primary button.</param>
<param name="emote">The emote for this primary button</param>
<param name="emote">The emote for this primary button.</param>
<returns>A builder with the newly created button.</returns> <returns>A builder with the newly created button.</returns>
</member> </member>
<member name="M:Discord.ButtonBuilder.CreateSecondaryButton(System.String,System.String,Discord.IEmote)"> <member name="M:Discord.ButtonBuilder.CreateSecondaryButton(System.String,System.String,Discord.IEmote)">
@@ -5457,7 +5457,7 @@
</summary> </summary>
<param name="label">The label for this secondary button.</param> <param name="label">The label for this secondary button.</param>
<param name="customId">The custom id for this secondary button.</param> <param name="customId">The custom id for this secondary button.</param>
<param name="emote">The emote for this secondary button</param>
<param name="emote">The emote for this secondary button.</param>
<returns>A builder with the newly created button.</returns> <returns>A builder with the newly created button.</returns>
</member> </member>
<member name="M:Discord.ButtonBuilder.CreateSuccessButton(System.String,System.String,Discord.IEmote)"> <member name="M:Discord.ButtonBuilder.CreateSuccessButton(System.String,System.String,Discord.IEmote)">
@@ -5466,14 +5466,14 @@
</summary> </summary>
<param name="label">The label for this success button.</param> <param name="label">The label for this success button.</param>
<param name="customId">The custom id for this success button.</param> <param name="customId">The custom id for this success button.</param>
<param name="emote">The emote for this success button</param>
<param name="emote">The emote for this success button.</param>
<returns>A builder with the newly created button.</returns> <returns>A builder with the newly created button.</returns>
</member> </member>
<member name="M:Discord.ButtonBuilder.WithLabel(System.String)"> <member name="M:Discord.ButtonBuilder.WithLabel(System.String)">
<summary> <summary>
Sets the current buttons label to the specified text. Sets the current buttons label to the specified text.
</summary> </summary>
<param name="label">The text for the label</param>
<param name="label">The text for the label.</param>
<inheritdoc cref="P:Discord.ButtonBuilder.Label"/> <inheritdoc cref="P:Discord.ButtonBuilder.Label"/>
<returns>The current builder.</returns> <returns>The current builder.</returns>
</member> </member>
@@ -9114,6 +9114,12 @@
<member name="P:Discord.GuildPermissions.CreatePrivateThreads"> <member name="P:Discord.GuildPermissions.CreatePrivateThreads">
<summary> If <c>true</c>, a user may create private threads in this guild. </summary> <summary> If <c>true</c>, a user may create private threads in this guild. </summary>
</member> </member>
<member name="P:Discord.GuildPermissions.UsePublicThreads">
<summary> If <c>true</c>, a user may use public threads in this guild. </summary>
</member>
<member name="P:Discord.GuildPermissions.UsePrivateThreads">
<summary> If <c>true</c>, a user may use private threads in this guild. </summary>
</member>
<member name="P:Discord.GuildPermissions.UseExternalStickers"> <member name="P:Discord.GuildPermissions.UseExternalStickers">
<summary> If <c>true</c>, a user may use external stickers in this guild. </summary> <summary> If <c>true</c>, a user may use external stickers in this guild. </summary>
</member> </member>
@@ -9129,10 +9135,10 @@
<member name="M:Discord.GuildPermissions.#ctor(System.String)"> <member name="M:Discord.GuildPermissions.#ctor(System.String)">
<summary> Creates a new <see cref="T:Discord.GuildPermissions"/> with the provided packed value after converting to ulong. </summary> <summary> Creates a new <see cref="T:Discord.GuildPermissions"/> with the provided packed value after converting to ulong. </summary>
</member> </member>
<member name="M:Discord.GuildPermissions.#ctor(System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean)">
<member name="M:Discord.GuildPermissions.#ctor(System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean,System.Boolean)">
<summary> Creates a new <see cref="T:Discord.GuildPermissions"/> structure with the provided permissions. </summary> <summary> Creates a new <see cref="T:Discord.GuildPermissions"/> structure with the provided permissions. </summary>
</member> </member>
<member name="M:Discord.GuildPermissions.Modify(System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean})">
<member name="M:Discord.GuildPermissions.Modify(System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean},System.Nullable{System.Boolean})">
<summary> Creates a new <see cref="T:Discord.GuildPermissions"/> from this one, changing the provided non-null permissions. </summary> <summary> Creates a new <see cref="T:Discord.GuildPermissions"/> from this one, changing the provided non-null permissions. </summary>
</member> </member>
<member name="M:Discord.GuildPermissions.Has(Discord.GuildPermission)"> <member name="M:Discord.GuildPermissions.Has(Discord.GuildPermission)">
@@ -11058,7 +11064,7 @@
</code> </code>
</example> </example>
<param name="msg">The message to add reactions to.</param> <param name="msg">The message to add reactions to.</param>
<param name="reactions">An array of reactions to add to the message</param>
<param name="reactions">An array of reactions to add to the message.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<returns> <returns>
A task that represents the asynchronous operation for adding a reaction to this message. A task that represents the asynchronous operation for adding a reaction to this message.
@@ -11080,7 +11086,7 @@
</code> </code>
</example> </example>
<param name="msg">The message to remove reactions from.</param> <param name="msg">The message to remove reactions from.</param>
<param name="reactions">An array of reactions to remove from the message</param>
<param name="reactions">An array of reactions to remove from the message.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<returns> <returns>
A task that represents the asynchronous operation for removing a reaction to this message. A task that represents the asynchronous operation for removing a reaction to this message.
@@ -11095,7 +11101,7 @@
<param name="text">The message to be sent.</param> <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> <param name="isTTS">Determines whether the message should be read aloud by Discord or not.</param>
<param name="embed">The <see cref="F:Discord.EmbedType.Rich"/> <see cref="T:Discord.Embed"/> to be sent.</param> <param name="embed">The <see cref="F:Discord.EmbedType.Rich"/> <see cref="T:Discord.Embed"/> to be sent.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10.</param>
<param name="allowedMentions"> <param name="allowedMentions">
Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>. Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
@@ -11130,13 +11136,13 @@
<param name="text">The message to be sent.</param> <param name="text">The message to be sent.</param>
<param name="isTTS">Whether the message should be read aloud by Discord or not.</param> <param name="isTTS">Whether the message should be read aloud by Discord or not.</param>
<param name="embed">The <see cref="F:Discord.EmbedType.Rich"/> <see cref="T:Discord.Embed"/> to be sent.</param> <param name="embed">The <see cref="F:Discord.EmbedType.Rich"/> <see cref="T:Discord.Embed"/> to be sent.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<param name="allowedMentions"> <param name="allowedMentions">
Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>. Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<returns> <returns>
A task that represents the asynchronous send operation. The task result contains the sent message. A task that represents the asynchronous send operation. The task result contains the sent message.
</returns> </returns>
@@ -12782,7 +12788,7 @@
<summary> <summary>
Not full URL validation right now. Just ensures protocol is present and that it's either http or https Not full URL validation right now. Just ensures protocol is present and that it's either http or https
</summary> </summary>
<param name="url">url to validate before sending to Discord</param>
<param name="url">url to validate before sending to Discord.</param>
<exception cref="T:System.InvalidOperationException">A URL must include a protocol (http or https).</exception> <exception cref="T:System.InvalidOperationException">A URL must include a protocol (http or https).</exception>
<returns>true if url is valid by our standard, false if null, throws an error upon invalid </returns> <returns>true if url is valid by our standard, false if null, throws an error upon invalid </returns>
</member> </member>


+ 4
- 4
src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs View File

@@ -28,9 +28,9 @@ namespace Discord
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param> /// <param name="stickers">A collection of stickers to send with the message.</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message. /// contains the sent message.
@@ -68,7 +68,7 @@ namespace Discord
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param> /// <param name="stickers">A collection of stickers to send with the file.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
@@ -104,7 +104,7 @@ namespace Discord
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param> /// <param name="stickers">A collection of stickers to send with the file.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result


+ 2
- 2
src/Discord.Net.Core/Entities/Channels/INestedChannel.cs View File

@@ -67,7 +67,7 @@ namespace Discord
/// await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3); /// await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3);
/// </code> /// </code>
/// </example> /// </example>
/// <param name="applicationId">The id of the embedded application to open for this invite</param>
/// <param name="applicationId">The id of the embedded application to open for this invite.</param>
/// <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param> /// <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param>
/// <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param> /// <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param>
/// <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param> /// <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param>
@@ -89,7 +89,7 @@ namespace Discord
/// await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3); /// await guildChannel.CreateInviteAsync(maxAge: 43200, maxUses: 3);
/// </code> /// </code>
/// </example> /// </example>
/// <param name="user">The id of the user whose stream to display for this invite</param>
/// <param name="user">The id of the user whose stream to display for this invite.</param>
/// <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param> /// <param name="maxAge">The time (in seconds) until the invite expires. Set to <c>null</c> to never expire.</param>
/// <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param> /// <param name="maxUses">The max amount of times this invite may be used. Set to <c>null</c> to have unlimited uses.</param>
/// <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param> /// <param name="isTemporary">If <c>true</c>, the user accepting this invite will be kicked from the guild after closing their client.</param>


+ 1
- 1
src/Discord.Net.Core/Entities/Channels/IStageChannel.cs View File

@@ -44,7 +44,7 @@ namespace Discord
/// Starts the stage, creating a stage instance. /// Starts the stage, creating a stage instance.
/// </summary> /// </summary>
/// <param name="topic">The topic for the stage/</param> /// <param name="topic">The topic for the stage/</param>
/// <param name="privacyLevel">The privacy level of the stage</param>
/// <param name="privacyLevel">The privacy level of the stage.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous start operation. /// A task that represents the asynchronous start operation.


+ 1
- 1
src/Discord.Net.Core/Entities/Guilds/IGuild.cs View File

@@ -1009,7 +1009,7 @@ namespace Discord
/// <param name="description">The description of the sticker.</param> /// <param name="description">The description of the sticker.</param>
/// <param name="tags">The tags of the sticker.</param> /// <param name="tags">The tags of the sticker.</param>
/// <param name="stream">The stream containing the file data.</param> /// <param name="stream">The stream containing the file data.</param>
/// <param name="filename">The name of the file <b>with</b> the extension, ex: image.png</param>
/// <param name="filename">The name of the file <b>with</b> the extension, ex: image.png.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous creation operation. The task result contains the created sticker. /// A task that represents the asynchronous creation operation. The task result contains the created sticker.


+ 1
- 1
src/Discord.Net.Core/Entities/Interactions/IApplicationCommandOption.cs View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Discord namespace Discord
{ {
/// <summary> /// <summary>
/// Options for the <see cref="IApplicationCommand"/>, see <see href="https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption"/>The docs</see>.
/// Options for the <see cref="IApplicationCommand"/>, see <see href="https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption">The docs</see>.
/// </summary> /// </summary>
public interface IApplicationCommandOption public interface IApplicationCommandOption
{ {


+ 5
- 5
src/Discord.Net.Core/Entities/Interactions/IDiscordInteraction.cs View File

@@ -44,12 +44,12 @@ namespace Discord
/// Responds to an Interaction with type <see cref="InteractionResponseType.ChannelMessageWithSource"/>. /// Responds to an Interaction with type <see cref="InteractionResponseType.ChannelMessageWithSource"/>.
/// </summary> /// </summary>
/// <param name="text">The text of the message to be sent.</param> /// <param name="text">The text of the message to be sent.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10.</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> /// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> /// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param> /// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param> /// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response.</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> /// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
Task RespondAsync (string text = null, Embed[] embeds = null, bool isTTS = false, Task RespondAsync (string text = null, Embed[] embeds = null, bool isTTS = false,
bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null); bool ephemeral = false, AllowedMentions allowedMentions = null, RequestOptions options = null, MessageComponent component = null, Embed embed = null);
@@ -57,13 +57,13 @@ namespace Discord
/// <summary> /// <summary>
/// Sends a followup message for this interaction. /// Sends a followup message for this interaction.
/// </summary> /// </summary>
/// <param name="text">The text of the message to be sent</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="text">The text of the message to be sent.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10.</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> /// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> /// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param> /// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param> /// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response.</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> /// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
/// <returns> /// <returns>
/// The sent message. /// The sent message.


+ 11
- 11
src/Discord.Net.Core/Entities/Interactions/Message Components/ComponentBuilder.cs View File

@@ -240,7 +240,7 @@ namespace Discord
/// <summary> /// <summary>
/// Builds this builder into a <see cref="MessageComponent"/> used to send your components. /// Builds this builder into a <see cref="MessageComponent"/> used to send your components.
/// </summary> /// </summary>
/// <returns>A <see cref="MessageComponent"/> that can be sent with <see cref="IMessageChannel.SendMessageAsync(string, bool, Embed, RequestOptions, AllowedMentions, MessageReference, MessageComponent)"/>.</returns>
/// <returns>A <see cref="MessageComponent"/> that can be sent with <see cref="IMessageChannel.SendMessageAsync"/>.</returns>
public MessageComponent Build() public MessageComponent Build()
{ {
if (this._actionRows != null) if (this._actionRows != null)
@@ -427,10 +427,10 @@ namespace Discord
/// </summary> /// </summary>
/// <param name="label">The label to use on the newly created link button.</param> /// <param name="label">The label to use on the newly created link button.</param>
/// <param name="url">The url of this button.</param> /// <param name="url">The url of this button.</param>
/// <param name="customId">The custom ID of this button</param>
/// <param name="style">The custom ID of this button</param>
/// <param name="emote">The emote of this button</param>
/// <param name="disabled">Disabled this button or not</param>
/// <param name="customId">The custom ID of this button.</param>
/// <param name="style">The custom ID of this button.</param>
/// <param name="emote">The emote of this button.</param>
/// <param name="disabled">Disabled this button or not.</param>
public ButtonBuilder(string label = null, string customId = null, ButtonStyle style = ButtonStyle.Primary, string url = null, IEmote emote = null, bool disabled = false) public ButtonBuilder(string label = null, string customId = null, ButtonStyle style = ButtonStyle.Primary, string url = null, IEmote emote = null, bool disabled = false)
{ {
this.CustomId = customId; this.CustomId = customId;
@@ -459,7 +459,7 @@ namespace Discord
/// </summary> /// </summary>
/// <param name="label">The label for this link button.</param> /// <param name="label">The label for this link button.</param>
/// <param name="url">The url for this link button to go to.</param> /// <param name="url">The url for this link button to go to.</param>
/// <param name="emote">The emote for this link button</param>
/// <param name="emote">The emote for this link button.</param>
/// <returns>A builder with the newly created button.</returns> /// <returns>A builder with the newly created button.</returns>
public static ButtonBuilder CreateLinkButton(string label, string url, IEmote emote = null) public static ButtonBuilder CreateLinkButton(string label, string url, IEmote emote = null)
=> new ButtonBuilder(label, null, ButtonStyle.Link, url, emote: emote); => new ButtonBuilder(label, null, ButtonStyle.Link, url, emote: emote);
@@ -469,7 +469,7 @@ namespace Discord
/// </summary> /// </summary>
/// <param name="label">The label for this danger button.</param> /// <param name="label">The label for this danger button.</param>
/// <param name="customId">The custom id for this danger button.</param> /// <param name="customId">The custom id for this danger button.</param>
/// <param name="emote">The emote for this danger button</param>
/// <param name="emote">The emote for this danger button.</param>
/// <returns>A builder with the newly created button.</returns> /// <returns>A builder with the newly created button.</returns>
public static ButtonBuilder CreateDangerButton(string label, string customId, IEmote emote = null) public static ButtonBuilder CreateDangerButton(string label, string customId, IEmote emote = null)
=> new ButtonBuilder(label, customId, ButtonStyle.Danger, emote: emote); => new ButtonBuilder(label, customId, ButtonStyle.Danger, emote: emote);
@@ -479,7 +479,7 @@ namespace Discord
/// </summary> /// </summary>
/// <param name="label">The label for this primary button.</param> /// <param name="label">The label for this primary button.</param>
/// <param name="customId">The custom id for this primary button.</param> /// <param name="customId">The custom id for this primary button.</param>
/// <param name="emote">The emote for this primary button</param>
/// <param name="emote">The emote for this primary button.</param>
/// <returns>A builder with the newly created button.</returns> /// <returns>A builder with the newly created button.</returns>
public static ButtonBuilder CreatePrimaryButton(string label, string customId, IEmote emote = null) public static ButtonBuilder CreatePrimaryButton(string label, string customId, IEmote emote = null)
=> new ButtonBuilder(label, customId, emote: emote); => new ButtonBuilder(label, customId, emote: emote);
@@ -489,7 +489,7 @@ namespace Discord
/// </summary> /// </summary>
/// <param name="label">The label for this secondary button.</param> /// <param name="label">The label for this secondary button.</param>
/// <param name="customId">The custom id for this secondary button.</param> /// <param name="customId">The custom id for this secondary button.</param>
/// <param name="emote">The emote for this secondary button</param>
/// <param name="emote">The emote for this secondary button.</param>
/// <returns>A builder with the newly created button.</returns> /// <returns>A builder with the newly created button.</returns>
public static ButtonBuilder CreateSecondaryButton(string label, string customId, IEmote emote = null) public static ButtonBuilder CreateSecondaryButton(string label, string customId, IEmote emote = null)
=> new ButtonBuilder(label, customId, ButtonStyle.Secondary, emote: emote); => new ButtonBuilder(label, customId, ButtonStyle.Secondary, emote: emote);
@@ -499,7 +499,7 @@ namespace Discord
/// </summary> /// </summary>
/// <param name="label">The label for this success button.</param> /// <param name="label">The label for this success button.</param>
/// <param name="customId">The custom id for this success button.</param> /// <param name="customId">The custom id for this success button.</param>
/// <param name="emote">The emote for this success button</param>
/// <param name="emote">The emote for this success button.</param>
/// <returns>A builder with the newly created button.</returns> /// <returns>A builder with the newly created button.</returns>
public static ButtonBuilder CreateSuccessButton(string label, string customId, IEmote emote = null) public static ButtonBuilder CreateSuccessButton(string label, string customId, IEmote emote = null)
=> new ButtonBuilder(label, customId, ButtonStyle.Success, emote: emote); => new ButtonBuilder(label, customId, ButtonStyle.Success, emote: emote);
@@ -507,7 +507,7 @@ namespace Discord
/// <summary> /// <summary>
/// Sets the current buttons label to the specified text. /// Sets the current buttons label to the specified text.
/// </summary> /// </summary>
/// <param name="label">The text for the label</param>
/// <param name="label">The text for the label.</param>
/// <inheritdoc cref="Label"/> /// <inheritdoc cref="Label"/>
/// <returns>The current builder.</returns> /// <returns>The current builder.</returns>
public ButtonBuilder WithLabel(string label) public ButtonBuilder WithLabel(string label)


+ 1
- 0
src/Discord.Net.Core/Entities/Interactions/Slash Commands/SlashCommandBuilder.cs View File

@@ -161,6 +161,7 @@ namespace Discord
/// <param name="description">The description of this option.</param> /// <param name="description">The description of this option.</param>
/// <param name="required">If this option is required for this command.</param> /// <param name="required">If this option is required for this command.</param>
/// <param name="isDefault">If this option is the default option.</param> /// <param name="isDefault">If this option is the default option.</param>
/// <param name="isAutocomplete">If this option is set to autocompleate.</param>
/// <param name="options">The options of the option to add.</param> /// <param name="options">The options of the option to add.</param>
/// <param name="choices">The choices of this option.</param> /// <param name="choices">The choices of this option.</param>
/// <returns>The current builder.</returns> /// <returns>The current builder.</returns>


+ 1
- 1
src/Discord.Net.Core/Entities/Users/IGuildUser.cs View File

@@ -84,7 +84,7 @@ namespace Discord
/// <example> /// <example>
/// <para>The following example checks if the current user has the ability to send a message with attachment in /// <para>The following example checks if the current user has the ability to send a message with attachment in
/// this channel; if so, uploads a file via <see cref="IMessageChannel.SendFileAsync(string, string, bool, Embed, RequestOptions, bool, AllowedMentions, MessageReference)"/>.</para> /// this channel; if so, uploads a file via <see cref="IMessageChannel.SendFileAsync(string, string, bool, Embed, RequestOptions, bool, AllowedMentions, MessageReference)"/>.</para>
/// <code language="cs">
/// <code language="cs">
/// if (currentUser?.GetPermissions(targetChannel)?.AttachFiles) /// if (currentUser?.GetPermissions(targetChannel)?.AttachFiles)
/// await targetChannel.SendFileAsync("fortnite.png"); /// await targetChannel.SendFileAsync("fortnite.png");
/// </code> /// </code>


+ 7
- 3
src/Discord.Net.Core/Extensions/MessageExtensions.cs View File

@@ -34,7 +34,7 @@ namespace Discord
/// </code> /// </code>
/// </example> /// </example>
/// <param name="msg">The message to add reactions to.</param> /// <param name="msg">The message to add reactions to.</param>
/// <param name="reactions">An array of reactions to add to the message</param>
/// <param name="reactions">An array of reactions to add to the message.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous operation for adding a reaction to this message. /// A task that represents the asynchronous operation for adding a reaction to this message.
@@ -59,7 +59,8 @@ namespace Discord
/// </code> /// </code>
/// </example> /// </example>
/// <param name="msg">The message to remove reactions from.</param> /// <param name="msg">The message to remove reactions from.</param>
/// <param name="reactions">An array of reactions to remove from the message</param>
/// <param name="user">The user who removed the reaction.</param>
/// <param name="reactions">An array of reactions to remove from the message.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous operation for removing a reaction to this message. /// A task that represents the asynchronous operation for removing a reaction to this message.
@@ -75,15 +76,18 @@ namespace Discord
/// <summary> /// <summary>
/// Sends an inline reply that references a message. /// Sends an inline reply that references a message.
/// </summary> /// </summary>
/// <param name="msg">The message that is being replyed on.</param>
/// <param name="text">The message to be sent.</param> /// <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> /// <param name="isTTS">Determines whether the message should be read aloud by Discord or not.</param>
/// <param name="embed">The <see cref="Discord.EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> /// <param name="embed">The <see cref="Discord.EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param>
/// <param name="allowedMentions"> /// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>. /// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <param name="components">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message. /// contains the sent message.


+ 4
- 2
src/Discord.Net.Core/Extensions/UserExtensions.cs View File

@@ -27,13 +27,13 @@ namespace Discord
/// <param name="text">The message to be sent.</param> /// <param name="text">The message to be sent.</param>
/// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param>
/// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <param name="allowedMentions"> /// <param name="allowedMentions">
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>. /// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous send operation. The task result contains the sent message. /// A task that represents the asynchronous send operation. The task result contains the sent message.
/// </returns> /// </returns>
@@ -85,6 +85,7 @@ namespace Discord
/// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param>
/// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <param name="component">The message component to be included with this message. Used for interactions.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message. /// contains the sent message.
@@ -142,6 +143,7 @@ namespace Discord
/// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param> /// <param name="isTTS">Whether the message should be read aloud by Discord or not.</param>
/// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param> /// <param name="embed">The <see cref="EmbedType.Rich"/> <see cref="Embed"/> to be sent.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <param name="component">The message component to be included with this message. Used for interactions.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message. /// contains the sent message.


+ 0
- 4
src/Discord.Net.Core/Net/ApplicationCommandException.cs View File

@@ -48,12 +48,8 @@ namespace Discord.Net
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ApplicationCommandException" /> class. /// Initializes a new instance of the <see cref="ApplicationCommandException" /> class.
/// </summary> /// </summary>
/// <param name="request">The request that was sent prior to the exception.</param>
/// <param name="requestJson"></param> /// <param name="requestJson"></param>
/// <param name="httpError"></param> /// <param name="httpError"></param>
/// <param name="discordCode">The Discord status code returned.</param>
/// <param name="reason">The reason behind the exception.</param>
/// <param name="errors"></param>
public ApplicationCommandException(string requestJson, HttpException httpError) public ApplicationCommandException(string requestJson, HttpException httpError)
: base("The application command failed to be created!", httpError) : base("The application command failed to be created!", httpError)
{ {


+ 1
- 1
src/Discord.Net.Core/Utils/UrlValidation.cs View File

@@ -7,7 +7,7 @@ namespace Discord.Utils
/// <summary> /// <summary>
/// Not full URL validation right now. Just ensures protocol is present and that it's either http or https /// Not full URL validation right now. Just ensures protocol is present and that it's either http or https
/// </summary> /// </summary>
/// <param name="url">url to validate before sending to Discord</param>
/// <param name="url">url to validate before sending to Discord.</param>
/// <exception cref="InvalidOperationException">A URL must include a protocol (http or https).</exception> /// <exception cref="InvalidOperationException">A URL must include a protocol (http or https).</exception>
/// <returns>true if url is valid by our standard, false if null, throws an error upon invalid </returns> /// <returns>true if url is valid by our standard, false if null, throws an error upon invalid </returns>
public static bool Validate(string url) public static bool Validate(string url)


+ 5
- 5
src/Discord.Net.Rest/Discord.Net.Rest.xml View File

@@ -1781,9 +1781,9 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the message.</param> <param name="stickers">A collection of stickers to send with the message.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message. contains the sent message.
@@ -1809,7 +1809,7 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the message.</param> <param name="stickers">A collection of stickers to send with the message.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
@@ -1836,7 +1836,7 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the message.</param> <param name="stickers">A collection of stickers to send with the message.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
@@ -3666,7 +3666,7 @@
<param name="description">The description of the sticker.</param> <param name="description">The description of the sticker.</param>
<param name="tags">The tags of the sticker.</param> <param name="tags">The tags of the sticker.</param>
<param name="stream">The stream containing the file data.</param> <param name="stream">The stream containing the file data.</param>
<param name="filename">The name of the file <b>with</b> the extension, ex: image.png</param>
<param name="filename">The name of the file <b>with</b> the extension, ex: image.png.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<returns> <returns>
A task that represents the asynchronous creation operation. The task result contains the created sticker. A task that represents the asynchronous creation operation. The task result contains the created sticker.


+ 4
- 4
src/Discord.Net.Rest/Entities/Channels/IRestMessageChannel.cs View File

@@ -25,9 +25,9 @@ namespace Discord.Rest
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param> /// <param name="stickers">A collection of stickers to send with the message.</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message. /// contains the sent message.
@@ -52,7 +52,7 @@ namespace Discord.Rest
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param> /// <param name="stickers">A collection of stickers to send with the message.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
@@ -78,7 +78,7 @@ namespace Discord.Rest
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param> /// <param name="stickers">A collection of stickers to send with the message.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result


+ 1
- 2
src/Discord.Net.Rest/Entities/Guilds/RestGuild.cs View File

@@ -494,7 +494,6 @@ namespace Discord.Rest
/// <summary> /// <summary>
/// Gets a collection of all stage channels in this guild. /// Gets a collection of all stage channels in this guild.
/// </summary> /// </summary>
/// <param name="mode">The <see cref="CacheMode"/> that determines whether the object should be fetched from cache.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous get operation. The task result contains a read-only collection of /// A task that represents the asynchronous get operation. The task result contains a read-only collection of
@@ -1044,7 +1043,7 @@ namespace Discord.Rest
/// <param name="description">The description of the sticker.</param> /// <param name="description">The description of the sticker.</param>
/// <param name="tags">The tags of the sticker.</param> /// <param name="tags">The tags of the sticker.</param>
/// <param name="stream">The stream containing the file data.</param> /// <param name="stream">The stream containing the file data.</param>
/// <param name="filename">The name of the file <b>with</b> the extension, ex: image.png</param>
/// <param name="filename">The name of the file <b>with</b> the extension, ex: image.png.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous creation operation. The task result contains the created sticker. /// A task that represents the asynchronous creation operation. The task result contains the created sticker.


+ 1
- 1
src/Discord.Net.WebSocket/API/Gateway/ExtendedGuild.cs View File

@@ -27,6 +27,6 @@ namespace Discord.API.Gateway
public DateTimeOffset JoinedAt { get; set; } public DateTimeOffset JoinedAt { get; set; }


[JsonProperty("threads")] [JsonProperty("threads")]
public Channel[] Threads { get; set; }
public new Channel[] Threads { get; set; }
} }
} }

+ 20
- 20
src/Discord.Net.WebSocket/Discord.Net.WebSocket.xml View File

@@ -1474,9 +1474,9 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the message.</param> <param name="stickers">A collection of stickers to send with the message.</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10</param>
<param name="embeds">A array of <see cref="T:Discord.Embed"/>s to send with this response. Max 10.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
contains the sent message. contains the sent message.
@@ -1501,7 +1501,7 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the file.</param> <param name="stickers">A collection of stickers to send with the file.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
@@ -1528,7 +1528,7 @@
If <c>null</c>, all mentioned roles and users will be notified. If <c>null</c>, all mentioned roles and users will be notified.
</param> </param>
<param name="messageReference">The message references to be included. Used to reply to specific messages.</param> <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
<param name="component">The message components to be included with this message. Used for interactions</param>
<param name="component">The message components to be included with this message. Used for interactions.</param>
<param name="stickers">A collection of stickers to send with the file.</param> <param name="stickers">A collection of stickers to send with the file.</param>
<returns> <returns>
A task that represents an asynchronous send operation for delivering the message. The task result A task that represents an asynchronous send operation for delivering the message. The task result
@@ -3632,7 +3632,7 @@
<param name="description">The description of the sticker.</param> <param name="description">The description of the sticker.</param>
<param name="tags">The tags of the sticker.</param> <param name="tags">The tags of the sticker.</param>
<param name="stream">The stream containing the file data.</param> <param name="stream">The stream containing the file data.</param>
<param name="filename">The name of the file <b>with</b> the extension, ex: image.png</param>
<param name="filename">The name of the file <b>with</b> the extension, ex: image.png.</param>
<param name="options">The options to be used when sending the request.</param> <param name="options">The options to be used when sending the request.</param>
<returns> <returns>
A task that represents the asynchronous creation operation. The task result contains the created sticker. A task that represents the asynchronous creation operation. The task result contains the created sticker.
@@ -4292,12 +4292,12 @@
</para> </para>
</summary> </summary>
<param name="text">The text of the message to be sent.</param> <param name="text">The text of the message to be sent.</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="embeds">A array of embeds to send with this response. Max 10.</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param> <param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param> <param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response.</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
<exception cref="T:System.ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="F:Discord.DiscordConfig.MaxMessageSize"/>.</exception> <exception cref="T:System.ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="F:Discord.DiscordConfig.MaxMessageSize"/>.</exception>
<exception cref="T:System.InvalidOperationException">The parameters provided were invalid or the token was invalid.</exception> <exception cref="T:System.InvalidOperationException">The parameters provided were invalid or the token was invalid.</exception>
@@ -4306,13 +4306,13 @@
<summary> <summary>
Sends a followup message for this interaction. Sends a followup message for this interaction.
</summary> </summary>
<param name="text">The text of the message to be sent</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="text">The text of the message to be sent.</param>
<param name="embeds">A array of embeds to send with this response. Max 10.</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param> <param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param> <param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response.</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
<returns> <returns>
The sent message. The sent message.
@@ -4322,15 +4322,15 @@
<summary> <summary>
Sends a followup message for this interaction. Sends a followup message for this interaction.
</summary> </summary>
<param name="text">The text of the message to be sent</param>
<param name="fileStream">The file to upload</param>
<param name="fileName">The file name of the attachment</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="text">The text of the message to be sent.</param>
<param name="fileStream">The file to upload.</param>
<param name="fileName">The file name of the attachment.</param>
<param name="embeds">A array of embeds to send with this response. Max 10.</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param> <param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param> <param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response.</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
<returns> <returns>
The sent message. The sent message.
@@ -4340,15 +4340,15 @@
<summary> <summary>
Sends a followup message for this interaction. Sends a followup message for this interaction.
</summary> </summary>
<param name="text">The text of the message to be sent</param>
<param name="filePath">The file to upload</param>
<param name="fileName">The file name of the attachment</param>
<param name="embeds">A array of embeds to send with this response. Max 10</param>
<param name="text">The text of the message to be sent.</param>
<param name="filePath">The file to upload.</param>
<param name="fileName">The file name of the attachment.</param>
<param name="embeds">A array of embeds to send with this response. Max 10.</param>
<param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
<param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
<param name="allowedMentions">The allowed mentions for this response.</param> <param name="allowedMentions">The allowed mentions for this response.</param>
<param name="options">The request options for this response.</param> <param name="options">The request options for this response.</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response</param>
<param name="component">A <see cref="T:Discord.MessageComponent"/> to be sent with this response.</param>
<param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
<returns> <returns>
The sent message. The sent message.


+ 4
- 4
src/Discord.Net.WebSocket/Entities/Channels/ISocketMessageChannel.cs View File

@@ -34,9 +34,9 @@ namespace Discord.WebSocket
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the message.</param> /// <param name="stickers">A collection of stickers to send with the message.</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10</param>
/// <param name="embeds">A array of <see cref="Embed"/>s to send with this response. Max 10.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message. /// contains the sent message.
@@ -60,7 +60,7 @@ namespace Discord.WebSocket
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param> /// <param name="stickers">A collection of stickers to send with the file.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result
@@ -86,7 +86,7 @@ namespace Discord.WebSocket
/// If <c>null</c>, all mentioned roles and users will be notified. /// If <c>null</c>, all mentioned roles and users will be notified.
/// </param> /// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param> /// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <param name="component">The message components to be included with this message. Used for interactions</param>
/// <param name="component">The message components to be included with this message. Used for interactions.</param>
/// <param name="stickers">A collection of stickers to send with the file.</param> /// <param name="stickers">A collection of stickers to send with the file.</param>
/// <returns> /// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result /// A task that represents an asynchronous send operation for delivering the message. The task result


+ 3
- 3
src/Discord.Net.WebSocket/Entities/Guilds/SocketGuild.cs View File

@@ -1376,7 +1376,7 @@ namespace Discord.WebSocket
/// <param name="description">The description of the sticker.</param> /// <param name="description">The description of the sticker.</param>
/// <param name="tags">The tags of the sticker.</param> /// <param name="tags">The tags of the sticker.</param>
/// <param name="stream">The stream containing the file data.</param> /// <param name="stream">The stream containing the file data.</param>
/// <param name="filename">The name of the file <b>with</b> the extension, ex: image.png</param>
/// <param name="filename">The name of the file <b>with</b> the extension, ex: image.png.</param>
/// <param name="options">The options to be used when sending the request.</param> /// <param name="options">The options to be used when sending the request.</param>
/// <returns> /// <returns>
/// A task that represents the asynchronous creation operation. The task result contains the created sticker. /// A task that represents the asynchronous creation operation. The task result contains the created sticker.
@@ -1666,10 +1666,10 @@ namespace Discord.WebSocket
Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options) Task<IVoiceChannel> IGuild.GetVoiceChannelAsync(ulong id, CacheMode mode, RequestOptions options)
=> Task.FromResult<IVoiceChannel>(GetVoiceChannel(id)); => Task.FromResult<IVoiceChannel>(GetVoiceChannel(id));
/// <inheritdoc /> /// <inheritdoc />
Task<IStageChannel> IGuild.GetStageChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Task<IStageChannel> IGuild.GetStageChannelAsync(ulong id, CacheMode mode, RequestOptions options)
=> Task.FromResult<IStageChannel>(GetStageChannel(id)); => Task.FromResult<IStageChannel>(GetStageChannel(id));
/// <inheritdoc /> /// <inheritdoc />
Task<IReadOnlyCollection<IStageChannel>> IGuild.GetStageChannelsAsync(CacheMode mode = CacheMode.AllowDownload, RequestOptions options = null)
Task<IReadOnlyCollection<IStageChannel>> IGuild.GetStageChannelsAsync(CacheMode mode, RequestOptions options)
=> Task.FromResult<IReadOnlyCollection<IStageChannel>>(StageChannels); => Task.FromResult<IReadOnlyCollection<IStageChannel>>(StageChannels);
/// <inheritdoc /> /// <inheritdoc />
Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options) Task<IVoiceChannel> IGuild.GetAFKChannelAsync(CacheMode mode, RequestOptions options)


+ 15
- 19
src/Discord.Net.WebSocket/Entities/Interaction/SocketInteraction.cs View File

@@ -117,18 +117,14 @@ namespace Discord.WebSocket


/// <summary> /// <summary>
/// Responds to an Interaction with type <see cref="InteractionResponseType.ChannelMessageWithSource"/>. /// Responds to an Interaction with type <see cref="InteractionResponseType.ChannelMessageWithSource"/>.
/// <para>
/// If you have <see cref="DiscordSocketConfig.AlwaysAcknowledgeInteractions"/> set to <see langword="true"/>, You should use
/// <see cref="FollowupAsync"/> instead.
/// </para>
/// </summary> /// </summary>
/// <param name="text">The text of the message to be sent.</param> /// <param name="text">The text of the message to be sent.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10.</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> /// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> /// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param> /// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param> /// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response.</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> /// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
/// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception> /// <exception cref="ArgumentOutOfRangeException">Message content is too long, length must be less or equal to <see cref="DiscordConfig.MaxMessageSize"/>.</exception>
/// <exception cref="InvalidOperationException">The parameters provided were invalid or the token was invalid.</exception> /// <exception cref="InvalidOperationException">The parameters provided were invalid or the token was invalid.</exception>
@@ -138,13 +134,13 @@ namespace Discord.WebSocket
/// <summary> /// <summary>
/// Sends a followup message for this interaction. /// Sends a followup message for this interaction.
/// </summary> /// </summary>
/// <param name="text">The text of the message to be sent</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="text">The text of the message to be sent.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10.</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> /// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> /// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param> /// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param> /// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response.</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> /// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
/// <returns> /// <returns>
/// The sent message. /// The sent message.
@@ -155,15 +151,15 @@ namespace Discord.WebSocket
/// <summary> /// <summary>
/// Sends a followup message for this interaction. /// Sends a followup message for this interaction.
/// </summary> /// </summary>
/// <param name="text">The text of the message to be sent</param>
/// <param name="fileStream">The file to upload</param>
/// <param name="fileName">The file name of the attachment</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="text">The text of the message to be sent.</param>
/// <param name="fileStream">The file to upload.</param>
/// <param name="fileName">The file name of the attachment.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10.</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> /// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> /// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param> /// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param> /// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response.</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> /// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
/// <returns> /// <returns>
/// The sent message. /// The sent message.
@@ -174,15 +170,15 @@ namespace Discord.WebSocket
/// <summary> /// <summary>
/// Sends a followup message for this interaction. /// Sends a followup message for this interaction.
/// </summary> /// </summary>
/// <param name="text">The text of the message to be sent</param>
/// <param name="filePath">The file to upload</param>
/// <param name="fileName">The file name of the attachment</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10</param>
/// <param name="text">The text of the message to be sent.</param>
/// <param name="filePath">The file to upload.</param>
/// <param name="fileName">The file name of the attachment.</param>
/// <param name="embeds">A array of embeds to send with this response. Max 10.</param>
/// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param> /// <param name="isTTS"><see langword="true"/> if the message should be read out by a text-to-speech reader, otherwise <see langword="false"/>.</param>
/// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param> /// <param name="ephemeral"><see langword="true"/> if the response should be hidden to everyone besides the invoker of the command, otherwise <see langword="false"/>.</param>
/// <param name="allowedMentions">The allowed mentions for this response.</param> /// <param name="allowedMentions">The allowed mentions for this response.</param>
/// <param name="options">The request options for this response.</param> /// <param name="options">The request options for this response.</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response</param>
/// <param name="component">A <see cref="MessageComponent"/> to be sent with this response.</param>
/// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param> /// <param name="embed">A single embed to send with this response. If this is passed alongside an array of embeds, the single embed will be ignored.</param>
/// <returns> /// <returns>
/// The sent message. /// The sent message.


+ 5
- 5
test/Discord.Net.Analyzers.Tests/Helpers/CodeFixVerifier.Helper.cs View File

@@ -18,7 +18,7 @@ namespace TestHelper
/// Apply the inputted CodeAction to the inputted document. /// Apply the inputted CodeAction to the inputted document.
/// Meant to be used to apply codefixes. /// Meant to be used to apply codefixes.
/// </summary> /// </summary>
/// <param name="document">The Document to apply the fix on</param>
/// <param name="document">The Document to apply the fix on.</param>
/// <param name="codeAction">A CodeAction that will be applied to the Document.</param> /// <param name="codeAction">A CodeAction that will be applied to the Document.</param>
/// <returns>A Document with the changes from the CodeAction</returns> /// <returns>A Document with the changes from the CodeAction</returns>
private static Document ApplyFix(Document document, CodeAction codeAction) private static Document ApplyFix(Document document, CodeAction codeAction)
@@ -33,8 +33,8 @@ namespace TestHelper
/// Note: Considers Diagnostics to be the same if they have the same Ids. In the case of multiple diagnostics with the same Id in a row, /// Note: Considers Diagnostics to be the same if they have the same Ids. In the case of multiple diagnostics with the same Id in a row,
/// this method may not necessarily return the new one. /// this method may not necessarily return the new one.
/// </summary> /// </summary>
/// <param name="diagnostics">The Diagnostics that existed in the code before the CodeFix was applied</param>
/// <param name="newDiagnostics">The Diagnostics that exist in the code after the CodeFix was applied</param>
/// <param name="diagnostics">The Diagnostics that existed in the code before the CodeFix was applied.</param>
/// <param name="newDiagnostics">The Diagnostics that exist in the code after the CodeFix was applied.</param>
/// <returns>A list of Diagnostics that only surfaced in the code after the CodeFix was applied</returns> /// <returns>A list of Diagnostics that only surfaced in the code after the CodeFix was applied</returns>
private static IEnumerable<Diagnostic> GetNewDiagnostics(IEnumerable<Diagnostic> diagnostics, IEnumerable<Diagnostic> newDiagnostics) private static IEnumerable<Diagnostic> GetNewDiagnostics(IEnumerable<Diagnostic> diagnostics, IEnumerable<Diagnostic> newDiagnostics)
{ {
@@ -61,7 +61,7 @@ namespace TestHelper
/// <summary> /// <summary>
/// Get the existing compiler diagnostics on the inputted document. /// Get the existing compiler diagnostics on the inputted document.
/// </summary> /// </summary>
/// <param name="document">The Document to run the compiler diagnostic analyzers on</param>
/// <param name="document">The Document to run the compiler diagnostic analyzers on.</param>
/// <returns>The compiler diagnostics that were found in the code</returns> /// <returns>The compiler diagnostics that were found in the code</returns>
private static IEnumerable<Diagnostic> GetCompilerDiagnostics(Document document) private static IEnumerable<Diagnostic> GetCompilerDiagnostics(Document document)
{ {
@@ -71,7 +71,7 @@ namespace TestHelper
/// <summary> /// <summary>
/// Given a document, turn it into a string based on the syntax root /// Given a document, turn it into a string based on the syntax root
/// </summary> /// </summary>
/// <param name="document">The Document to be converted to a string</param>
/// <param name="document">The Document to be converted to a string.</param>
/// <returns>A string containing the syntax of the Document after formatting</returns> /// <returns>A string containing the syntax of the Document after formatting</returns>
private static string GetStringFromDocument(Document document) private static string GetStringFromDocument(Document document)
{ {


+ 12
- 12
test/Discord.Net.Analyzers.Tests/Helpers/DiagnosticVerifier.Helper.cs View File

@@ -35,9 +35,9 @@ namespace TestHelper
/// <summary> /// <summary>
/// Given classes in the form of strings, their language, and an IDiagnosticAnlayzer to apply to it, return the diagnostics found in the string after converting it to a document. /// Given classes in the form of strings, their language, and an IDiagnosticAnlayzer to apply to it, return the diagnostics found in the string after converting it to a document.
/// </summary> /// </summary>
/// <param name="sources">Classes in the form of strings</param>
/// <param name="language">The language the source classes are in</param>
/// <param name="analyzer">The analyzer to be run on the sources</param>
/// <param name="sources">Classes in the form of strings.</param>
/// <param name="language">The language the source classes are in.</param>
/// <param name="analyzer">The analyzer to be run on the sources.</param>
/// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns> /// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns>
private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer) private static Diagnostic[] GetSortedDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer)
{ {
@@ -48,8 +48,8 @@ namespace TestHelper
/// Given an analyzer and a document to apply it to, run the analyzer and gather an array of diagnostics found in it. /// Given an analyzer and a document to apply it to, run the analyzer and gather an array of diagnostics found in it.
/// The returned diagnostics are then ordered by location in the source document. /// The returned diagnostics are then ordered by location in the source document.
/// </summary> /// </summary>
/// <param name="analyzer">The analyzer to run on the documents</param>
/// <param name="documents">The Documents that the analyzer will be run on</param>
/// <param name="analyzer">The analyzer to run on the documents.</param>
/// <param name="documents">The Documents that the analyzer will be run on.</param>
/// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns> /// <returns>An IEnumerable of Diagnostics that surfaced in the source code, sorted by Location</returns>
protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents) protected static Diagnostic[] GetSortedDiagnosticsFromDocuments(DiagnosticAnalyzer analyzer, Document[] documents)
{ {
@@ -93,7 +93,7 @@ namespace TestHelper
/// <summary> /// <summary>
/// Sort diagnostics by location in source document /// Sort diagnostics by location in source document
/// </summary> /// </summary>
/// <param name="diagnostics">The list of Diagnostics to be sorted</param>
/// <param name="diagnostics">The list of Diagnostics to be sorted.</param>
/// <returns>An IEnumerable containing the Diagnostics in order of Location</returns> /// <returns>An IEnumerable containing the Diagnostics in order of Location</returns>
private static Diagnostic[] SortDiagnostics(IEnumerable<Diagnostic> diagnostics) private static Diagnostic[] SortDiagnostics(IEnumerable<Diagnostic> diagnostics)
{ {
@@ -106,8 +106,8 @@ namespace TestHelper
/// <summary> /// <summary>
/// Given an array of strings as sources and a language, turn them into a project and return the documents and spans of it. /// Given an array of strings as sources and a language, turn them into a project and return the documents and spans of it.
/// </summary> /// </summary>
/// <param name="sources">Classes in the form of strings</param>
/// <param name="language">The language the source code is in</param>
/// <param name="sources">Classes in the form of strings.</param>
/// <param name="language">The language the source code is in.</param>
/// <returns>A Tuple containing the Documents produced from the sources and their TextSpans if relevant</returns> /// <returns>A Tuple containing the Documents produced from the sources and their TextSpans if relevant</returns>
private static Document[] GetDocuments(string[] sources, string language) private static Document[] GetDocuments(string[] sources, string language)
{ {
@@ -130,8 +130,8 @@ namespace TestHelper
/// <summary> /// <summary>
/// Create a Document from a string through creating a project that contains it. /// Create a Document from a string through creating a project that contains it.
/// </summary> /// </summary>
/// <param name="source">Classes in the form of a string</param>
/// <param name="language">The language the source code is in</param>
/// <param name="source">Classes in the form of a string.</param>
/// <param name="language">The language the source code is in.</param>
/// <returns>A Document created from the source string</returns> /// <returns>A Document created from the source string</returns>
protected static Document CreateDocument(string source, string language = LanguageNames.CSharp) protected static Document CreateDocument(string source, string language = LanguageNames.CSharp)
{ {
@@ -141,8 +141,8 @@ namespace TestHelper
/// <summary> /// <summary>
/// Create a project using the inputted strings as sources. /// Create a project using the inputted strings as sources.
/// </summary> /// </summary>
/// <param name="sources">Classes in the form of strings</param>
/// <param name="language">The language the source code is in</param>
/// <param name="sources">Classes in the form of strings.</param>
/// <param name="language">The language the source code is in.</param>
/// <returns>A Project created out of the Documents created from the source strings</returns> /// <returns>A Project created out of the Documents created from the source strings</returns>
private static Project CreateProject(string[] sources, string language = LanguageNames.CSharp) private static Project CreateProject(string[] sources, string language = LanguageNames.CSharp)
{ {


+ 17
- 17
test/Discord.Net.Analyzers.Tests/Verifiers/CodeFixVerifier.cs View File

@@ -1,4 +1,4 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Diagnostics;
@@ -38,10 +38,10 @@ namespace TestHelper
/// <summary> /// <summary>
/// Called to test a C# codefix when applied on the inputted string as a source /// Called to test a C# codefix when applied on the inputted string as a source
/// </summary> /// </summary>
/// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it</param>
/// <param name="newSource">A class in the form of a string after the CodeFix was applied to it</param>
/// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple</param>
/// <param name="allowNewCompilerDiagnostics">A bool controlling whether or not the test will fail if the CodeFix introduces other warnings after being applied</param>
/// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it.</param>
/// <param name="newSource">A class in the form of a string after the CodeFix was applied to it.</param>
/// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple.</param>
/// <param name="allowNewCompilerDiagnostics">A bool controlling whether or not the test will fail if the CodeFix introduces other warnings after being applied.</param>
protected void VerifyCSharpFix(string oldSource, string newSource, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false) protected void VerifyCSharpFix(string oldSource, string newSource, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false)
{ {
VerifyFix(LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), GetCSharpCodeFixProvider(), oldSource, newSource, codeFixIndex, allowNewCompilerDiagnostics); VerifyFix(LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), GetCSharpCodeFixProvider(), oldSource, newSource, codeFixIndex, allowNewCompilerDiagnostics);
@@ -50,10 +50,10 @@ namespace TestHelper
/// <summary> /// <summary>
/// Called to test a VB codefix when applied on the inputted string as a source /// Called to test a VB codefix when applied on the inputted string as a source
/// </summary> /// </summary>
/// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it</param>
/// <param name="newSource">A class in the form of a string after the CodeFix was applied to it</param>
/// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple</param>
/// <param name="allowNewCompilerDiagnostics">A bool controlling whether or not the test will fail if the CodeFix introduces other warnings after being applied</param>
/// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it.</param>
/// <param name="newSource">A class in the form of a string after the CodeFix was applied to it.</param>
/// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple.</param>
/// <param name="allowNewCompilerDiagnostics">A bool controlling whether or not the test will fail if the CodeFix introduces other warnings after being applied.</param>
protected void VerifyBasicFix(string oldSource, string newSource, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false) protected void VerifyBasicFix(string oldSource, string newSource, int? codeFixIndex = null, bool allowNewCompilerDiagnostics = false)
{ {
VerifyFix(LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), GetBasicCodeFixProvider(), oldSource, newSource, codeFixIndex, allowNewCompilerDiagnostics); VerifyFix(LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), GetBasicCodeFixProvider(), oldSource, newSource, codeFixIndex, allowNewCompilerDiagnostics);
@@ -65,13 +65,13 @@ namespace TestHelper
/// Then gets the string after the codefix is applied and compares it with the expected result. /// Then gets the string after the codefix is applied and compares it with the expected result.
/// Note: If any codefix causes new diagnostics to show up, the test fails unless allowNewCompilerDiagnostics is set to true. /// Note: If any codefix causes new diagnostics to show up, the test fails unless allowNewCompilerDiagnostics is set to true.
/// </summary> /// </summary>
/// <param name="language">The language the source code is in</param>
/// <param name="analyzer">The analyzer to be applied to the source code</param>
/// <param name="codeFixProvider">The codefix to be applied to the code wherever the relevant Diagnostic is found</param>
/// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it</param>
/// <param name="newSource">A class in the form of a string after the CodeFix was applied to it</param>
/// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple</param>
/// <param name="allowNewCompilerDiagnostics">A bool controlling whether or not the test will fail if the CodeFix introduces other warnings after being applied</param>
/// <param name="language">The language the source code is in.</param>
/// <param name="analyzer">The analyzer to be applied to the source code.</param>
/// <param name="codeFixProvider">The codefix to be applied to the code wherever the relevant Diagnostic is found.</param>
/// <param name="oldSource">A class in the form of a string before the CodeFix was applied to it.</param>
/// <param name="newSource">A class in the form of a string after the CodeFix was applied to it.</param>
/// <param name="codeFixIndex">Index determining which codefix to apply if there are multiple.</param>
/// <param name="allowNewCompilerDiagnostics">A bool controlling whether or not the test will fail if the CodeFix introduces other warnings after being applied.</param>
private void VerifyFix(string language, DiagnosticAnalyzer analyzer, CodeFixProvider codeFixProvider, string oldSource, string newSource, int? codeFixIndex, bool allowNewCompilerDiagnostics) private void VerifyFix(string language, DiagnosticAnalyzer analyzer, CodeFixProvider codeFixProvider, string oldSource, string newSource, int? codeFixIndex, bool allowNewCompilerDiagnostics)
{ {
var document = CreateDocument(oldSource, language); var document = CreateDocument(oldSource, language);
@@ -126,4 +126,4 @@ namespace TestHelper
Assert.Equal(newSource, actual); Assert.Equal(newSource, actual);
} }
} }
}
}

+ 21
- 21
test/Discord.Net.Analyzers.Tests/Verifiers/DiagnosticVerifier.cs View File

@@ -37,8 +37,8 @@ namespace TestHelper
/// Called to test a C# DiagnosticAnalyzer when applied on the single inputted string as a source /// Called to test a C# DiagnosticAnalyzer when applied on the single inputted string as a source
/// Note: input a DiagnosticResult for each Diagnostic expected /// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary> /// </summary>
/// <param name="source">A class in the form of a string to run the analyzer on</param>
/// <param name="expected"> DiagnosticResults that should appear after the analyzer is run on the source</param>
/// <param name="source">A class in the form of a string to run the analyzer on.</param>
/// <param name="expected"> DiagnosticResults that should appear after the analyzer is run on the source.</param>
protected void VerifyCSharpDiagnostic(string source, params DiagnosticResult[] expected) protected void VerifyCSharpDiagnostic(string source, params DiagnosticResult[] expected)
{ {
VerifyDiagnostics(new[] { source }, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected); VerifyDiagnostics(new[] { source }, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected);
@@ -48,8 +48,8 @@ namespace TestHelper
/// Called to test a VB DiagnosticAnalyzer when applied on the single inputted string as a source /// Called to test a VB DiagnosticAnalyzer when applied on the single inputted string as a source
/// Note: input a DiagnosticResult for each Diagnostic expected /// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary> /// </summary>
/// <param name="source">A class in the form of a string to run the analyzer on</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the source</param>
/// <param name="source">A class in the form of a string to run the analyzer on.</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the source.</param>
protected void VerifyBasicDiagnostic(string source, params DiagnosticResult[] expected) protected void VerifyBasicDiagnostic(string source, params DiagnosticResult[] expected)
{ {
VerifyDiagnostics(new[] { source }, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected); VerifyDiagnostics(new[] { source }, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected);
@@ -59,8 +59,8 @@ namespace TestHelper
/// Called to test a C# DiagnosticAnalyzer when applied on the inputted strings as a source /// Called to test a C# DiagnosticAnalyzer when applied on the inputted strings as a source
/// Note: input a DiagnosticResult for each Diagnostic expected /// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary> /// </summary>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on.</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources.</param>
protected void VerifyCSharpDiagnostic(string[] sources, params DiagnosticResult[] expected) protected void VerifyCSharpDiagnostic(string[] sources, params DiagnosticResult[] expected)
{ {
VerifyDiagnostics(sources, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected); VerifyDiagnostics(sources, LanguageNames.CSharp, GetCSharpDiagnosticAnalyzer(), expected);
@@ -70,8 +70,8 @@ namespace TestHelper
/// Called to test a VB DiagnosticAnalyzer when applied on the inputted strings as a source /// Called to test a VB DiagnosticAnalyzer when applied on the inputted strings as a source
/// Note: input a DiagnosticResult for each Diagnostic expected /// Note: input a DiagnosticResult for each Diagnostic expected
/// </summary> /// </summary>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on.</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources.</param>
protected void VerifyBasicDiagnostic(string[] sources, params DiagnosticResult[] expected) protected void VerifyBasicDiagnostic(string[] sources, params DiagnosticResult[] expected)
{ {
VerifyDiagnostics(sources, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected); VerifyDiagnostics(sources, LanguageNames.VisualBasic, GetBasicDiagnosticAnalyzer(), expected);
@@ -81,10 +81,10 @@ namespace TestHelper
/// General method that gets a collection of actual diagnostics found in the source after the analyzer is run, /// General method that gets a collection of actual diagnostics found in the source after the analyzer is run,
/// then verifies each of them. /// then verifies each of them.
/// </summary> /// </summary>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on</param>
/// <param name="language">The language of the classes represented by the source strings</param>
/// <param name="analyzer">The analyzer to be run on the source code</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources</param>
/// <param name="sources">An array of strings to create source documents from to run the analyzers on.</param>
/// <param name="language">The language of the classes represented by the source strings.</param>
/// <param name="analyzer">The analyzer to be run on the source code.</param>
/// <param name="expected">DiagnosticResults that should appear after the analyzer is run on the sources.</param>
private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected) private void VerifyDiagnostics(string[] sources, string language, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expected)
{ {
var diagnostics = GetSortedDiagnostics(sources, language, analyzer); var diagnostics = GetSortedDiagnostics(sources, language, analyzer);
@@ -98,9 +98,9 @@ namespace TestHelper
/// Checks each of the actual Diagnostics found and compares them with the corresponding DiagnosticResult in the array of expected results. /// Checks each of the actual Diagnostics found and compares them with the corresponding DiagnosticResult in the array of expected results.
/// Diagnostics are considered equal only if the DiagnosticResultLocation, Id, Severity, and Message of the DiagnosticResult match the actual diagnostic. /// Diagnostics are considered equal only if the DiagnosticResultLocation, Id, Severity, and Message of the DiagnosticResult match the actual diagnostic.
/// </summary> /// </summary>
/// <param name="actualResults">The Diagnostics found by the compiler after running the analyzer on the source code</param>
/// <param name="analyzer">The analyzer that was being run on the sources</param>
/// <param name="expectedResults">Diagnostic Results that should have appeared in the code</param>
/// <param name="actualResults">The Diagnostics found by the compiler after running the analyzer on the source code.</param>
/// <param name="analyzer">The analyzer that was being run on the sources.</param>
/// <param name="expectedResults">Diagnostic Results that should have appeared in the code.</param>
private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults) private static void VerifyDiagnosticResults(IEnumerable<Diagnostic> actualResults, DiagnosticAnalyzer analyzer, params DiagnosticResult[] expectedResults)
{ {
int expectedCount = expectedResults.Length; int expectedCount = expectedResults.Length;
@@ -173,10 +173,10 @@ namespace TestHelper
/// <summary> /// <summary>
/// Helper method to VerifyDiagnosticResult that checks the location of a diagnostic and compares it with the location in the expected DiagnosticResult. /// Helper method to VerifyDiagnosticResult that checks the location of a diagnostic and compares it with the location in the expected DiagnosticResult.
/// </summary> /// </summary>
/// <param name="analyzer">The analyzer that was being run on the sources</param>
/// <param name="diagnostic">The diagnostic that was found in the code</param>
/// <param name="actual">The Location of the Diagnostic found in the code</param>
/// <param name="expected">The DiagnosticResultLocation that should have been found</param>
/// <param name="analyzer">The analyzer that was being run on the sources.</param>
/// <param name="diagnostic">The diagnostic that was found in the code.</param>
/// <param name="actual">The Location of the Diagnostic found in the code.</param>
/// <param name="expected">The DiagnosticResultLocation that should have been found.</param>
private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected) private static void VerifyDiagnosticLocation(DiagnosticAnalyzer analyzer, Diagnostic diagnostic, Location actual, DiagnosticResultLocation expected)
{ {
var actualSpan = actual.GetLineSpan(); var actualSpan = actual.GetLineSpan();
@@ -215,8 +215,8 @@ namespace TestHelper
/// <summary> /// <summary>
/// Helper method to format a Diagnostic into an easily readable string /// Helper method to format a Diagnostic into an easily readable string
/// </summary> /// </summary>
/// <param name="analyzer">The analyzer that this verifier tests</param>
/// <param name="diagnostics">The Diagnostics to be formatted</param>
/// <param name="analyzer">The analyzer that this verifier tests.</param>
/// <param name="diagnostics">The Diagnostics to be formatted.</param>
/// <returns>The Diagnostics formatted as a string</returns> /// <returns>The Diagnostics formatted as a string</returns>
private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics) private static string FormatDiagnostics(DiagnosticAnalyzer analyzer, params Diagnostic[] diagnostics)
{ {


Loading…
Cancel
Save