Fix typos in comments and documentation (#2608)

* Fix typos in comments and documentations

* Fixes more typo
This commit is contained in:
Ge
2023-02-27 03:49:16 +08:00
committed by GitHub
parent 709364aaef
commit ee617d8ef3
56 changed files with 137 additions and 138 deletions

View File

@@ -9,7 +9,7 @@ Build overrides are a way for library developers to override the default behavio
## Installing the package
The build override package can be installed on nuget [here](TODO) or by using the package manager
The build override package can be installed on nuget [here](https://www.nuget.org/packages/Discord.Net.BuildOverrides) or by using the package manager
```
PM> Install-Package Discord.Net.BuildOverrides
@@ -37,5 +37,5 @@ Overrides are normally built for specific problems, for example if someone is ha
## Security and Transparency
Overrides can only be created and updated by library developers, you should only apply an override if a library developer askes you to.
Overrides can only be created and updated by library developers, you should only apply an override if a library developer asks you to.
Code for the overrides server and the overrides themselves can be found [here](https://github.com/discord-net/Discord.Net.BuildOverrides).

View File

@@ -13,12 +13,12 @@ as well as users that register and handle commands manually.
The difference between these 3 functions is in how you handle the command response.
[RespondAsync] and
[DeferAsync] let the API know you have succesfully received the command. This is also called 'acknowledging' a command.
[DeferAsync] let the API know you have successfully received the command. This is also called 'acknowledging' a command.
DeferAsync will not send out a response, RespondAsync will.
[FollowupAsync] follows up on succesful acknowledgement.
[FollowupAsync] follows up on successful acknowledgement.
> [!WARNING]
> If you have not acknowledged the command FollowupAsync will not work! the interaction has not been resonded to, so you cannot follow it up!
> If you have not acknowledged the command FollowupAsync will not work! the interaction has not been responded to, so you cannot follow it up!
[RespondAsync]: xref:Discord.IDiscordInteraction
[DeferAsync]: xref:Discord.IDiscordInteraction

View File

@@ -1,6 +1,6 @@
# Ratelimits
Ratelimits are a core concept of any API - Discords API is no exception. each verified library must follow the ratelimit guidelines.
Ratelimits are a core concept of any API - Discords API is no exception. Each verified library must follow the ratelimit guidelines.
### Using the ratelimit callback

View File

@@ -26,7 +26,7 @@ Injecting through properties is also allowed as follows.
> [!WARNING]
> Dependency Injection will not resolve missing services in property injection, and it will not pick a constructor instead.
> If a publically accessible property is attempted to be injected and its service is missing, the application will throw an error.
> If a publicly accessible property is attempted to be injected and its service is missing, the application will throw an error.
## Using the provider itself

View File

@@ -18,7 +18,7 @@ Casting only works for types that inherit the base type that you want to unbox f
A boxed object is the definition of an object that was simplified (or trimmed) by incoming traffic,
but still owns the data of the originally constructed type. Boxing is an implicit operation.
Through casting, we can **unbox** this type, and access the properties that were unaccessible before.
Through casting, we can **unbox** this type, and access the properties that were inaccessible before.
## Unboxing

View File

@@ -87,8 +87,8 @@ exist under a category.
![IInteractionChart](images/IInteraction.png)
* A **Slash command** ([ISlashCommandInteraction]) is an application command executed in the text box, with provided parameters.
* A **Message Command** ([IMessageCommandInteraction]) is an application command targetting a message.
* An **User Command** ([IUserCommandInteraction]) is an application command targetting a user.
* A **Message Command** ([IMessageCommandInteraction]) is an application command targeting a message.
* An **User Command** ([IUserCommandInteraction]) is an application command targeting a user.
* An **Application Command** ([IApplicationCommandInteraction]) is any of the above.
* A **Message component** ([IMessageComponent]) is the interaction of a button being clicked/dropdown option(s) entered.
* An **Autocomplete Interaction** ([IAutocompleteinteraction]) is an interaction that has been automatically completed.

View File

@@ -28,4 +28,4 @@ var guild = client.GetGuild(guildId);
var guildEvent = await guild.CreateEventAsync("test event", DateTimeOffset.UtcNow.AddDays(1), GuildScheduledEventType.External, endTime: DateTimeOffset.UtcNow.AddDays(2), location: "Space");
```
This code will create an event that lasts a day and starts tomorrow. It will be an external event thats in space.
This code will create an event that lasts a day and starts tomorrow. It will be an external event that's in space.

View File

@@ -5,7 +5,7 @@ title: Introduction to Guild Events
# Guild Events
Guild events are a way to host events within a guild. They offer alot of features and flexibility.
Guild events are a way to host events within a guild. They offer a lot of features and flexibility.
## Getting started with guild events

View File

@@ -5,7 +5,7 @@ title: Modifying Guild Events
# Modifying Events
You can modify events using the `ModifyAsync` method to modify the event, heres the properties you can modify:
You can modify events using the `ModifyAsync` method to modify the event. Here are the properties you can modify:
| Name | Type | Description |
| ------------ | --------------------------------- | -------------------------------------------- |

View File

@@ -107,7 +107,7 @@ By default, your methods can feature the following parameter types:
| `IVoiceChannel` | Voice Channels |
| `IDMChannel` | DM Channels |
| `IGroupChannel` | Group Channels |
| `ICategory Channel` | Category Channels |
| `ICategoryChannel` | Category Channels |
| `INewsChannel` | News Channels |
| `IThreadChannel` | Public, Private, News Threads |
| `ITextChannel` | Text Channels |
@@ -200,7 +200,7 @@ And the captured words will be passed on to the command method in the same order
You may use as many wild card characters as you want.
> [!NOTE]
> If Interaction Service recieves a component interaction with **player:play,rickroll** custom id,
> If Interaction Service receives a component interaction with **player:play,rickroll** custom id,
> `op` will be *play* and `name` will be *rickroll*
## Select Menus
@@ -262,7 +262,7 @@ One problem with using the concrete type InteractionContexts is that you cannot
> [!INFO]
> Message component interactions have access to a special method called `UpdateAsync()` to update the body of the method the interaction originated from.
> Normally this wouldn't be accessable without casting the `Context.Interaction`.
> Normally this wouldn't be accessible without casting the `Context.Interaction`.
[!code-csharp[Context Example](samples/intro/context.cs)]
@@ -291,7 +291,7 @@ Module groups allow you to create sub-commands and sub-commands groups.
By nesting commands inside a module that is tagged with [GroupAttribute] you can create prefixed commands.
> [!WARNING]
> Although creating nested module stuctures are allowed,
> Although creating nested module structures are allowed,
> you are not permitted to use more than 2 [GroupAttribute]'s in module hierarchy.
> [!NOTE]
@@ -318,7 +318,7 @@ An example of executing a command from an event can be seen here:
[!code-csharp[Command Event Example](samples/intro/event.cs)]
Commands can be either executed on the gateway thread or on a seperate thread from the thread pool.
Commands can be either executed on the gateway thread or on a separate thread from the thread pool.
This behaviour can be configured by changing the `RunMode` property of `InteractionServiceConfig` or by setting the *runMode* parameter of a command attribute.
> [!WARNING]
@@ -354,12 +354,12 @@ can be used to register cherry picked modules or commands to global/guild scopes
> [!NOTE]
> In debug environment, since Global commands can take up to 1 hour to register/update,
> it is adviced to register your commands to a test guild for your changes to take effect immediately.
> it is advised to register your commands to a test guild for your changes to take effect immediately.
> You can use preprocessor directives to create a simple logic for registering commands as seen above.
## Interaction Utility
Interaction Service ships with a static `InteractionUtiliy`
Interaction Service ships with a static `InteractionUtility`
class which contains some helper methods to asynchronously waiting for Discord Interactions.
For instance, `WaitForInteractionAsync()` method allows you to wait for an Interaction for a given amount of time.
This method returns the first encountered Interaction that satisfies the provided predicate.
@@ -370,7 +370,7 @@ This method returns the first encountered Interaction that satisfies the provide
## Webhook Based Interactions
Instead of using the gateway to recieve Discord Interactions, Discord allows you to recieve Interaction events over Webhooks.
Instead of using the gateway to receive Discord Interactions, Discord allows you to receive Interaction events over Webhooks.
Interaction Service also supports this Interaction type but to be able to
respond to the Interactions within your command modules you need to perform the following:

View File

@@ -32,7 +32,7 @@ Interaction Result come in a handful of different flavours:
> [!NOTE]
> You can either use the [IResult.Error] property of an Interaction result or create type check for the
> afformentioned result types to branch out your post-execution logic to handle different situations.
> aforementioned result types to branch out your post-execution logic to handle different situations.
[AutocompletionResult]: xref:Discord.AutocompleteResult

View File

@@ -10,7 +10,7 @@ command parser.
> [!IMPORTANT]
> The 'Message Content' intent, required for text commands, is now a
> privilleged intent. Please use [Slash commands](xref:Guides.SlashCommands.Intro)
> privileged intent. Please use [Slash commands](xref:Guides.SlashCommands.Intro)
> instead for making commands. For more information about this change
> please check [this announcement made by discord](https://support-dev.discord.com/hc/en-us/articles/4404772028055-Message-Content-Privileged-Intent-FAQ)

View File

@@ -17,7 +17,7 @@ bot. (When developing on .NET Framework, this would be `bin/debug`,
when developing on .NET Core, this is where you execute `dotnet run`
from; typically the same directory as your csproj).
**For Windows users, precompiled binaries are available for your convienence [here](https://github.com/discord-net/Discord.Net/tree/dev/voice-natives).**
**For Windows users, precompiled binaries are available for your convenience [here](https://github.com/discord-net/Discord.Net/tree/dev/voice-natives).**
**For Linux users, you will need to compile [Sodium] and [Opus] from source, or install them from your package manager.**

View File

@@ -69,7 +69,7 @@ namespace Discord
public sealed class LoadedOverride
{
/// <summary>
/// Gets the aseembly containing the overrides definition.
/// Gets the assembly containing the overrides definition.
/// </summary>
public Assembly Assembly { get; internal set; }
@@ -119,7 +119,7 @@ namespace Discord
/// Gets details about a specific override.
/// </summary>
/// <remarks>
/// <b>Note:</b> This method does not load an override, it simply retrives the info about it.
/// <b>Note:</b> This method does not load an override, it simply retrieves the info about it.
/// </remarks>
/// <param name="name">The name of the override to get.</param>
/// <returns>
@@ -147,12 +147,12 @@ namespace Discord
/// Adds an override to the current Discord.Net instance.
/// </summary>
/// <remarks>
/// The override initialization is non-blocking, any errors that occor within
/// The override initialization is non-blocking, any errors that occur within
/// the overrides initialization procedure will be sent in the <see cref="Log"/> event.
/// </remarks>
/// <param name="name">The name of the override to add.</param>
/// <returns>
/// A task representing the asynchronous add operaton. The tasks result is a boolean
/// A task representing the asynchronous add operation. The tasks result is a boolean
/// determining if the add operation was successful.
/// </returns>
public static async Task<bool> AddOverrideAsync(string name)
@@ -169,12 +169,12 @@ namespace Discord
/// Adds an override to the current Discord.Net instance.
/// </summary>
/// <remarks>
/// The override initialization is non-blocking, any errors that occor within
/// The override initialization is non-blocking, any errors that occur within
/// the overrides initialization procedure will be sent in the <see cref="Log"/> event.
/// </remarks>
/// <param name="ovrride">The override to add.</param>
/// <returns>
/// A task representing the asynchronous add operaton. The tasks result is a boolean
/// A task representing the asynchronous add operation. The tasks result is a boolean
/// determining if the add operation was successful.
/// </returns>
public static async Task<bool> AddOverrideAsync(Override ovrride)

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace Discord.Overrides
{
/// <summary>
/// Represents context thats passed to an override in the initialization step.
/// Represents context that's passed to an override in the initialization step.
/// </summary>
public sealed class OverrideContext
{

View File

@@ -90,7 +90,7 @@ namespace BasicBot
if (message.Content == "!ping")
{
// Create a new componentbuilder, in which dropdowns & buttons can be created.
// Create a new ComponentBuilder, in which dropdowns & buttons can be created.
var cb = new ComponentBuilder()
.WithButton("Click me!", "unique-id", ButtonStyle.Primary);

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace InteractionFramework.Modules
{
// Interation modules must be public and inherit from an IInterationModuleBase
// Interaction modules must be public and inherit from an IInteractionModuleBase
public class ExampleModule : InteractionModuleBase<SocketInteractionContext>
{
// Dependencies can be accessed through Property injection, public properties with public setters will be set by the service provider

View File

@@ -589,7 +589,7 @@ namespace Discord.Commands
var executeResult = await matchResult.Match.Value.ExecuteAsync(context, parseResult, services);
if (!executeResult.IsSuccess && !(executeResult is RuntimeResult || executeResult is ExecuteResult)) // succesful results raise the event in CommandInfo#ExecuteInternalAsync (have to raise it there b/c deffered execution)
if (!executeResult.IsSuccess && !(executeResult is RuntimeResult || executeResult is ExecuteResult)) // successful results raise the event in CommandInfo#ExecuteInternalAsync (have to raise it there b/c deferred execution)
await _commandExecutedEvent.InvokeAsync(matchResult.Match.Value.Command, context, executeResult);
return executeResult;
}

View File

@@ -17,19 +17,19 @@ namespace Discord.Commands
/// <summary>
/// Executed asynchronously before a command is run in this module base.
/// </summary>
/// <param name="command">The command thats about to run.</param>
/// <param name="command">The command that's about to run.</param>
Task BeforeExecuteAsync(CommandInfo command);
/// <summary>
/// Executed before a command is run in this module base.
/// </summary>
/// <param name="command">The command thats about to run.</param>
/// <param name="command">The command that's about to run.</param>
void BeforeExecute(CommandInfo command);
/// <summary>
/// Executed asynchronously after a command is run in this module base.
/// </summary>
/// <param name="command">The command thats about to run.</param>
/// <param name="command">The command that's about to run.</param>
Task AfterExecuteAsync(CommandInfo command);
/// <summary>

View File

@@ -194,7 +194,7 @@ namespace Discord
public bool UseSystemClock { get; set; } = true;
/// <summary>
/// Gets or sets whether or not the internal experation check uses the system date
/// Gets or sets whether or not the internal expiration check uses the system date
/// + snowflake date to check if an interaction can be responded to.
/// </summary>
/// <remarks>

View File

@@ -5,7 +5,7 @@ namespace Discord
/// <summary> No messages will be scanned. </summary>
Disabled = 0,
/// <summary> Scans messages from all guild members that do not have a role. </summary>
/// <remarks> Recommented option for servers that use roles for trusted membership. </remarks>
/// <remarks> Recommended option for servers that use roles for trusted membership. </remarks>
MembersWithoutRoles = 1,
/// <summary> Scan messages sent by all guild members. </summary>
AllMembers = 2

View File

@@ -35,7 +35,7 @@ namespace Discord
/// Gets the description of the event.
/// </summary>
/// <remarks>
/// This field is <see langword="null"/> when the event doesn't have a discription.
/// This field is <see langword="null"/> when the event doesn't have a description.
/// </remarks>
string Description { get; }
@@ -71,7 +71,7 @@ namespace Discord
/// <summary>
/// Gets the optional entity id of the event. The "entity" of the event
/// can be a stage instance event as is seperate from <see cref="ChannelId"/>.
/// can be a stage instance event as is separate from <see cref="ChannelId"/>.
/// </summary>
ulong? EntityId { get; }
@@ -102,7 +102,7 @@ namespace Discord
/// </returns>
Task StartAsync(RequestOptions options = null);
/// <summary>
/// Ends or canceles the event.
/// Ends or cancels the event.
/// </summary>
/// <param name="options">The options to be used when sending the request.</param>
/// <returns>

View File

@@ -1,7 +1,7 @@
namespace Discord
{
/// <summary>
/// Respresents a <see cref="IMessageComponent"/> text input.
/// Represents a <see cref="IMessageComponent"/> text input.
/// </summary>
public class TextInputComponent : IMessageComponent
{

View File

@@ -10,7 +10,7 @@ namespace Discord
internal override ApplicationCommandType Type => ApplicationCommandType.Slash;
/// <summary>
/// Gets or sets the discription of this command.
/// Gets or sets the description of this command.
/// </summary>
public Optional<string> Description { get; set; }

View File

@@ -165,7 +165,7 @@ namespace Discord
/// </summary>
/// <param name="json">The json string to parse.</param>
/// <param name="builder">The <see cref="EmbedBuilder"/> with populated values. An empty instance if method returns <see langword="false"/>.</param>
/// <returns><see langword="true"/> if <paramref name="json"/> was succesfully parsed. <see langword="false"/> if not.</returns>
/// <returns><see langword="true"/> if <paramref name="json"/> was successfully parsed. <see langword="false"/> if not.</returns>
public static bool TryParse(string json, out EmbedBuilder builder)
{
builder = new EmbedBuilder();

View File

@@ -99,7 +99,7 @@ namespace Discord
/// <param name="guildId">Id of the target guild.</param>
/// <param name="allow">The value of this permission.</param>
/// <returns>
/// Instance of <see cref="ApplicationCommandPermission"/> targeting everychannel in a guild.
/// Instance of <see cref="ApplicationCommandPermission"/> targeting every channel in a guild.
/// </returns>
public static ApplicationCommandPermission ForAllChannels(ulong guildId, bool allow) =>
new(guildId - 1, ApplicationCommandPermissionTarget.Channel, allow);
@@ -110,7 +110,7 @@ namespace Discord
/// <param name="guild">Target guild.</param>
/// <param name="allow">The value of this permission.</param>
/// <returns>
/// Instance of <see cref="ApplicationCommandPermission"/> targeting everychannel in a guild.
/// Instance of <see cref="ApplicationCommandPermission"/> targeting every channel in a guild.
/// </returns>
public static ApplicationCommandPermission ForAllChannels(IGuild guild, bool allow) =>
ForAllChannels(guild.Id, allow);

View File

@@ -33,7 +33,7 @@ namespace Discord
/// </returns>
bool? IsRevoked { get; }
/// <summary>
/// Gets a <see cref="IReadOnlyCollection{T}"/> of integration parials.
/// Gets a <see cref="IReadOnlyCollection{T}"/> of integration partials.
/// </summary>
IReadOnlyCollection<IIntegration> Integrations { get; }
/// <summary>

View File

@@ -111,7 +111,7 @@ namespace Discord
/// Formats a user's username + discriminator.
/// </summary>
/// <param name="doBidirectional">To format the string in bidirectional unicode or not</param>
/// <param name="user">The user whos username and discriminator to format</param>
/// <param name="user">The user whose username and discriminator to format</param>
/// <returns>The username + discriminator</returns>
public static string UsernameAndDiscriminator(IUser user, bool doBidirectional)
{

View File

@@ -14,7 +14,7 @@ namespace Discord.Interactions
public bool IsRequired { get; }
/// <summary>
/// Sets the input as required or optinal.
/// Sets the input as required or optional.
/// </summary>
/// <param name="isRequired">Whether or not user input is required for this input.</param>
public RequiredInputAttribute(bool isRequired = true)

View File

@@ -23,7 +23,7 @@ namespace Discord.Interactions.Builders
/// <inheritdoc/>
public ModuleBuilder Module { get; }
//// <inheritdoc/>
/// <inheritdoc/>
public ExecuteCallback Callback { get; internal set; }
/// <inheritdoc/>

View File

@@ -34,7 +34,7 @@ namespace Discord.Interactions.Builders
bool IsParameterArray { get; }
/// <summary>
/// Gets the deafult value of this parameter.
/// Gets the default value of this parameter.
/// </summary>
object DefaultValue { get; }

View File

@@ -26,7 +26,7 @@ namespace Discord.Interactions
bool IgnoreGroupNames { get; }
/// <summary>
/// Gets wheter this command supports wild card patterns.
/// Gets whether this command supports wild card patterns.
/// </summary>
bool SupportsWildCards { get; }

View File

@@ -95,8 +95,8 @@ namespace Discord.Interactions
/// Creates an <see cref="IModal"/> and fills it with provided message components.
/// </summary>
/// <param name="context">Context of the <see cref="IModalInteraction"/> that will be injected into the modal.</param>
/// <param name="services">Services to be passed onto the <see cref="ComponentTypeConverter"/>s of the modal fiels.</param>
/// <param name="throwOnMissingField">Wheter or not this method should exit on encountering a missing modal field.</param>
/// <param name="services">Services to be passed onto the <see cref="ComponentTypeConverter"/>s of the modal fields.</param>
/// <param name="throwOnMissingField">Whether or not this method should exit on encountering a missing modal field.</param>
/// <returns>
/// A <see cref="TypeConverterResult"/> if a type conversion has failed, else a <see cref="ParseResult"/>.
/// </returns>

View File

@@ -34,7 +34,7 @@ namespace Discord.Interactions
public double? MinValue { get; }
/// <summary>
/// Gets the maxmimum value permitted for a number type parameter.
/// Gets the maximum value permitted for a number type parameter.
/// </summary>
public double? MaxValue { get; }
@@ -55,7 +55,7 @@ namespace Discord.Interactions
public TypeConverter TypeConverter { get; }
/// <summary>
/// Gets the <see cref="IAutocompleteHandler"/> thats linked to this parameter.
/// Gets the <see cref="IAutocompleteHandler"/> that's linked to this parameter.
/// </summary>
public IAutocompleteHandler AutocompleteHandler { get; }

View File

@@ -19,7 +19,7 @@ namespace Discord.Interactions
public class InteractionService : IDisposable
{
/// <summary>
/// Occurs when a Slash Command related information is recieved.
/// Occurs when a Slash Command related information is received.
/// </summary>
public event Func<LogMessage, Task> Log { add { _logEvent.Add(value); } remove { _logEvent.Remove(value); } }
internal readonly AsyncEvent<Func<LogMessage, Task>> _logEvent = new();

View File

@@ -24,7 +24,7 @@ namespace Discord.Interactions
public bool ThrowOnError { get; set; } = true;
/// <summary>
/// Gets or sets the delimiters that will be used to seperate group names and the method name when a Message Component Interaction is recieved.
/// Gets or sets the delimiters that will be used to separate group names and the method name when a Message Component Interaction is received.
/// </summary>
public char[] InteractionCustomIdDelimiters { get; set; }
@@ -51,7 +51,7 @@ namespace Discord.Interactions
public bool EnableAutocompleteHandlers { get; set; } = true;
/// <summary>
/// Gets or sets whether new service scopes should be automatically created when resolving module depedencies on every command execution.
/// Gets or sets whether new service scopes should be automatically created when resolving module dependencies on every command execution.
/// </summary>
public bool AutoServiceScopes { get; set; } = true;

View File

@@ -5,7 +5,7 @@ using System.Threading.Tasks;
namespace Discord.Interactions
{
/// <summary>
/// Respresents a localization provider for Discord Application Commands.
/// Represents a localization provider for Discord Application Commands.
/// </summary>
public interface ILocalizationManager
{

View File

@@ -8,7 +8,7 @@ namespace Discord.Interactions
public struct TypeConverterResult : IResult
{
/// <summary>
/// Gets the result of the convertion if the operation was successful.
/// Gets the result of the conversion if the operation was successful.
/// </summary>
public object Value { get; }
@@ -37,7 +37,7 @@ namespace Discord.Interactions
/// <summary>
/// Returns a <see cref="TypeConverterResult" /> with <see cref="InteractionCommandError.Exception" /> and the <see cref="Exception.Message"/>.
/// </summary>
/// <param name="exception">The exception that caused the type convertion to fail.</param>
/// <param name="exception">The exception that caused the type conversion to fail.</param>
public static TypeConverterResult FromError(Exception exception) =>
new TypeConverterResult(null, InteractionCommandError.Exception, exception.Message);

View File

@@ -20,8 +20,8 @@ namespace Discord.Interactions
/// <summary>
/// Will be used to read the incoming payload before executing the method body.
/// </summary>
/// <param name="context">Command exexution context.</param>
/// <param name="option">Recieved option payload.</param>
/// <param name="context">Command execution context.</param>
/// <param name="option">Received option payload.</param>
/// <param name="services">Service provider that will be used to initialize the command module.</param>
/// <returns>
/// The result of the read process.

View File

@@ -45,7 +45,7 @@ namespace Discord.Interactions
/// Enum values tagged with this attribute will not be displayed as a parameter choice
/// </summary>
/// <remarks>
/// This attributer must be used along with the default <see cref="EnumConverter{T}"/>
/// This attribute must be used along with the default <see cref="EnumConverter{T}"/>
/// </remarks>
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public sealed class HideAttribute : Attribute { }

View File

@@ -24,8 +24,8 @@ namespace Discord.Interactions
/// <summary>
/// Will be used to read the incoming payload before executing the method body.
/// </summary>
/// <param name="context">Command exexution context.</param>
/// <param name="option">Recieved option payload.</param>
/// <param name="context">Command execution context.</param>
/// <param name="option">Received option payload.</param>
/// <param name="services">Service provider that will be used to initialize the command module.</param>
/// <returns>The result of the read process.</returns>
public abstract Task<TypeConverterResult> ReadAsync(IInteractionContext context, IApplicationCommandInteractionDataOption option, IServiceProvider services);

View File

@@ -11,14 +11,14 @@ namespace Discord.Interactions
public static class InteractionUtility
{
/// <summary>
/// Wait for an Interaction event for a given amount of time as an asynchronous opration.
/// Wait for an Interaction event for a given amount of time as an asynchronous operation.
/// </summary>
/// <param name="client">Client that should be listened to for the <see cref="BaseSocketClient.InteractionCreated"/> event.</param>
/// <param name="timeout">Timeout duration for this operation.</param>
/// <param name="predicate">Delegate for cheking whether an Interaction meets the requirements.</param>
/// <param name="predicate">Delegate for checking whether an Interaction meets the requirements.</param>
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
/// <returns>
/// A Task representing the asyncronous waiting operation. If the user responded in the given amount of time, Task result contains the user response,
/// A Task representing the asynchronous waiting operation. If the user responded in the given amount of time, Task result contains the user response,
/// otherwise the Task result is <see langword="null"/>.
/// </returns>
public static async Task<SocketInteraction> WaitForInteractionAsync(BaseSocketClient client, TimeSpan timeout,
@@ -55,14 +55,14 @@ namespace Discord.Interactions
}
/// <summary>
/// Wait for an Message Component Interaction event for a given amount of time as an asynchronous opration .
/// Wait for an Message Component Interaction event for a given amount of time as an asynchronous operation .
/// </summary>
/// <param name="client">Client that should be listened to for the <see cref="BaseSocketClient.InteractionCreated"/> event.</param>
/// <param name="fromMessage">The message that <see cref="BaseSocketClient.ButtonExecuted"/> or <see cref="BaseSocketClient.SelectMenuExecuted"/> should originate from.</param>
/// <param name="timeout">Timeout duration for this operation.</param>
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
/// <returns>
/// A Task representing the asyncronous waiting operation with a <see cref="IDiscordInteraction"/> result,
/// A Task representing the asynchronous waiting operation with a <see cref="IDiscordInteraction"/> result,
/// the result is null if the process timed out before receiving a valid Interaction.
/// </returns>
public static Task<SocketInteraction> WaitForMessageComponentAsync(BaseSocketClient client, IUserMessage fromMessage, TimeSpan timeout,
@@ -83,7 +83,7 @@ namespace Discord.Interactions
/// <param name="message">Optional custom prompt message.</param>
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
/// <returns>
/// A Task representing the asyncronous waiting operation with a <see cref="bool"/> result,
/// A Task representing the asynchronous waiting operation with a <see cref="bool"/> result,
/// the result is <see langword="false"/> if the user declined the prompt or didnt answer in time, <see langword="true"/> if the user confirmed the prompt.
/// </returns>
public static async Task<bool> ConfirmAsync(BaseSocketClient client, IMessageChannel channel, TimeSpan timeout, string message = null,

View File

@@ -8,7 +8,7 @@ namespace System.Text.RegularExpressions
internal static class RegexUtils
{
internal const byte Q = 5; // quantifier
internal const byte S = 4; // ordinary stoppper
internal const byte S = 4; // ordinary stopper
internal const byte Z = 3; // ScanBlank stopper
internal const byte X = 2; // whitespace
internal const byte E = 1; // should be escaped

View File

@@ -2328,7 +2328,7 @@ namespace Discord.API
.Append(args.ActionType.Value);
}
// Still use string interp for the query w/o params, as this is necessary for CreateBucketId
// Still use string interpolation for the query w/o params, as this is necessary for CreateBucketId
endpoint = () => $"guilds/{guildId}/audit-logs?limit={limit}{queryArgs.ToString()}";
return await SendAsync<AuditLog>("GET", endpoint, ids, options: options).ConfigureAwait(false);
}

View File

@@ -7,7 +7,7 @@ using Model = Discord.API.AuditLog;
namespace Discord.Rest
{
/// <summary>
/// Contains a piece of audit log data related to a scheduled event deleteion.
/// Contains a piece of audit log data related to a scheduled event deletion.
/// </summary>
public class ScheduledEventDeleteAuditLogData : IAuditLogData
{

View File

@@ -35,7 +35,7 @@ namespace Discord.Rest
public RestUser User { get; }
/// <summary>
/// Gets the <see cref="RestInteraction"/> the command was recieved with.
/// Gets the <see cref="RestInteraction"/> the command was received with.
/// </summary>
public TInteraction Interaction { get; }
@@ -83,7 +83,7 @@ namespace Discord.Rest
/// <inheritdoc/>
IEnumerable<IRouteSegmentMatch> IRouteMatchContainer.SegmentMatches => SegmentMatches;
// IInterationContext
// IInteractionContext
/// <inheritdoc/>
IDiscordClient IInteractionContext.Client => Client;

View File

@@ -55,7 +55,7 @@ namespace Discord.Net.ED25519
/// <param name="xOffset">Offset of byte sequence in the x array</param>
/// <param name="y">Byte array</param>
/// <param name="yOffset">Offset of byte sequence in the y array</param>
/// <param name="length">Lengh of byte sequence</param>
/// <param name="length">Length of byte sequence</param>
/// <returns>True if sequences are equal</returns>
public static bool ConstantTimeEquals(byte[] x, int xOffset, byte[] y, int yOffset, int length)
{

View File

@@ -2382,7 +2382,7 @@ namespace Discord.WebSocket
channel = CreateDMChannel(data.ChannelId.Value, user, State);
}
// The channel isnt required when responding to an interaction, so we can leave the channel null.
// The channel isn't required when responding to an interaction, so we can leave the channel null.
}
}
else if (data.User.IsSpecified)

View File

@@ -59,7 +59,7 @@ namespace Discord.WebSocket
/// Gets or sets whether or not the client should download the default stickers on startup.
/// </summary>
/// <remarks>
/// When this is set to <see langword="false"/> default stickers arn't present and cannot be resolved by the client.
/// When this is set to <see langword="false"/> default stickers aren't present and cannot be resolved by the client.
/// This will make all default stickers have the type of <see cref="SocketUnknownSticker"/>.
/// </remarks>
public bool AlwaysDownloadDefaultStickers { get; set; } = false;

View File

@@ -202,7 +202,7 @@ namespace Discord.WebSocket
/// <returns>A task representing the download operation.</returns>
public async Task<IReadOnlyCollection<SocketThreadUser>> GetUsersAsync(RequestOptions options = null)
{
// download all users if we havent
// download all users if we haven't
if (!_usersDownloaded)
{
await DownloadUsersAsync(options);

View File

@@ -1212,7 +1212,7 @@ namespace Discord.WebSocket
/// Gets a collection of all users in this guild.
/// </summary>
/// <remarks>
/// <para>This method retrieves all users found within this guild throught REST.</para>
/// <para>This method retrieves all users found within this guild through REST.</para>
/// <para>Users returned by this method are not cached.</para>
/// </remarks>
/// <param name="options">The options to be used when sending the request.</param>

View File

@@ -401,7 +401,7 @@ namespace Discord.WebSocket
#endregion
/// <summary>
/// Attepts to get the channel this interaction was executed in.
/// Attempts to get the channel this interaction was executed in.
/// </summary>
/// <param name="options">The request options for this <see langword="async"/> request.</param>
/// <returns>

View File

@@ -34,7 +34,7 @@ namespace Discord.Interactions
public SocketUser User { get; }
/// <summary>
/// Gets the <see cref="SocketInteraction"/> the command was recieved with.
/// Gets the <see cref="SocketInteraction"/> the command was received with.
/// </summary>
public TInteraction Interaction { get; }

View File

@@ -33,7 +33,7 @@ namespace TestHelper
#region Get Diagnostics
/// <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 IDiagnosticAnalyzer to apply to it, return the diagnostics found in the string after converting it to a document.
/// </summary>
/// <param name="sources">Classes in the form of strings.</param>
/// <param name="language">The language the source classes are in.</param>
@@ -203,4 +203,3 @@ namespace TestHelper
}
}
}

View File

@@ -171,7 +171,7 @@ namespace Discord
}
/// <summary>
/// Tests that valid url's do not throw any exceptions.
/// Tests that valid url does not throw any exceptions.
/// </summary>
/// <param name="url">The url to set.</param>
[Theory]