Fix typos in comments and documentation (#2608)
* Fix typos in comments and documentations * Fixes more typo
This commit is contained in:
@@ -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
|
||||
@@ -21,7 +21,7 @@ PM> Install-Package Discord.Net.BuildOverrides
|
||||
public async Task MainAsync()
|
||||
{
|
||||
// hook into the log function
|
||||
BuildOverrides.Log += (buildOverride, message) =>
|
||||
BuildOverrides.Log += (buildOverride, message) =>
|
||||
{
|
||||
Console.WriteLine($"{buildOverride.Name}: {message}");
|
||||
return Task.CompletedTask;
|
||||
@@ -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.
|
||||
Code for the overrides server and the overrides themselves can be found [here](https://github.com/discord-net/Discord.Net.BuildOverrides).
|
||||
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).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ uid: Guides.DI.Scaling
|
||||
title: Scaling your DI
|
||||
---
|
||||
|
||||
# Scaling your DI
|
||||
# Scaling your DI
|
||||
|
||||
Dependency injection has a lot of use cases, and is very suitable for scaled applications.
|
||||
There are a few ways to make registering & using services easier in large amounts.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -87,8 +87,8 @@ exist under a category.
|
||||

|
||||
|
||||
* 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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 |
|
||||
| ------------ | --------------------------------- | -------------------------------------------- |
|
||||
|
||||
@@ -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
|
||||
@@ -233,9 +233,9 @@ A Modal implementation would look like this:
|
||||
[!code-csharp[Modal Command](samples/intro/modal.cs)]
|
||||
|
||||
> [!NOTE]
|
||||
> If you are using Modals in the interaction service it is **highly
|
||||
> If you are using Modals in the interaction service it is **highly
|
||||
> recommended** that you enable `PreCompiledLambdas` in your config
|
||||
> to prevent performance issues.
|
||||
> to prevent performance issues.
|
||||
|
||||
## Interaction Context
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,8 +9,8 @@ title: Introduction to the Chat Command Service
|
||||
command parser.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> The 'Message Content' intent, required for text commands, is now a
|
||||
> privilleged intent. Please use [Slash commands](xref:Guides.SlashCommands.Intro)
|
||||
> The 'Message Content' intent, required for text commands, is now a
|
||||
> 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)
|
||||
|
||||
|
||||
@@ -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.**
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -9,12 +9,12 @@ namespace Discord
|
||||
/// </summary>
|
||||
public class DiscordConfig
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns the API version Discord.Net uses.
|
||||
/// <summary>
|
||||
/// Returns the API version Discord.Net uses.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An <see cref="int"/> representing the API version that Discord.Net uses to communicate with Discord.
|
||||
/// <para>A list of available API version can be seen on the official
|
||||
/// <para>A list of available API version can be seen on the official
|
||||
/// <see href="https://discord.com/developers/docs/reference#api-versioning">Discord API documentation</see>
|
||||
/// .</para>
|
||||
/// </returns>
|
||||
@@ -53,14 +53,14 @@ namespace Discord
|
||||
/// The Discord API URL using <see cref="APIVersion"/>.
|
||||
/// </returns>
|
||||
public static readonly string APIUrl = $"https://discord.com/api/v{APIVersion}/";
|
||||
/// <summary>
|
||||
/// Returns the base Discord CDN URL.
|
||||
/// <summary>
|
||||
/// Returns the base Discord CDN URL.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The base Discord Content Delivery Network (CDN) URL.
|
||||
/// </returns>
|
||||
public const string CDNUrl = "https://cdn.discordapp.com/";
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Returns the base Discord invite URL.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
@@ -68,28 +68,28 @@ namespace Discord
|
||||
/// </returns>
|
||||
public const string InviteUrl = "https://discord.gg/";
|
||||
|
||||
/// <summary>
|
||||
/// Returns the default timeout for requests.
|
||||
/// <summary>
|
||||
/// Returns the default timeout for requests.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The amount of time it takes in milliseconds before a request is timed out.
|
||||
/// </returns>
|
||||
public const int DefaultRequestTimeout = 15000;
|
||||
/// <summary>
|
||||
/// Returns the max length for a Discord message.
|
||||
/// <summary>
|
||||
/// Returns the max length for a Discord message.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The maximum length of a message allowed by Discord.
|
||||
/// </returns>
|
||||
public const int MaxMessageSize = 2000;
|
||||
/// <summary>
|
||||
/// Returns the max messages allowed to be in a request.
|
||||
/// <summary>
|
||||
/// Returns the max messages allowed to be in a request.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The maximum number of messages that can be gotten per-batch.
|
||||
/// </returns>
|
||||
public const int MaxMessagesPerBatch = 100;
|
||||
/// <summary>
|
||||
/// <summary>
|
||||
/// Returns the max users allowed to be in a request.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
@@ -110,8 +110,8 @@ namespace Discord
|
||||
/// The maximum number of users that can be gotten per-batch.
|
||||
/// </returns>
|
||||
public const int MaxGuildEventUsersPerBatch = 100;
|
||||
/// <summary>
|
||||
/// Returns the max guilds allowed to be in a request.
|
||||
/// <summary>
|
||||
/// Returns the max guilds allowed to be in a request.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The maximum number of guilds that can be gotten per-batch.
|
||||
@@ -124,8 +124,8 @@ namespace Discord
|
||||
/// The maximum number of user reactions that can be gotten per-batch.
|
||||
/// </returns>
|
||||
public const int MaxUserReactionsPerBatch = 100;
|
||||
/// <summary>
|
||||
/// Returns the max audit log entries allowed to be in a request.
|
||||
/// <summary>
|
||||
/// Returns the max audit log entries allowed to be in a request.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The maximum number of audit log entries that can be gotten per-batch.
|
||||
@@ -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>
|
||||
@@ -215,8 +215,8 @@ namespace Discord
|
||||
/// </remarks>
|
||||
public bool FormatUsersInBidirectionalUnicode { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the max thread members allowed to be in a request.
|
||||
/// <summary>
|
||||
/// Returns the max thread members allowed to be in a request.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// The maximum number of thread members that can be gotten per-batch.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
@@ -134,7 +134,7 @@ namespace Discord
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <note type="important">
|
||||
/// The returned collection is an asynchronous enumerable object; one must call
|
||||
/// The returned collection is an asynchronous enumerable object; one must call
|
||||
/// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual messages as a
|
||||
/// collection.
|
||||
/// </note>
|
||||
@@ -155,7 +155,7 @@ namespace Discord
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <note type="important">
|
||||
/// The returned collection is an asynchronous enumerable object; one must call
|
||||
/// The returned collection is an asynchronous enumerable object; one must call
|
||||
/// <see cref="AsyncEnumerableExtensions.FlattenAsync{T}"/> to access the individual users as a
|
||||
/// collection.
|
||||
/// </note>
|
||||
@@ -165,7 +165,7 @@ namespace Discord
|
||||
/// </note>
|
||||
/// This method will attempt to fetch the number of users specified under <paramref name="limit"/> around
|
||||
/// the user <paramref name="fromUserId"/> depending on the <paramref name="dir"/>. The library will
|
||||
/// attempt to split up the requests according to your <paramref name="limit"/> and
|
||||
/// attempt to split up the requests according to your <paramref name="limit"/> and
|
||||
/// <see cref="DiscordConfig.MaxGuildEventUsersPerBatch"/>. In other words, should the user request 500 users,
|
||||
/// and the <see cref="Discord.DiscordConfig.MaxGuildEventUsersPerBatch"/> constant is <c>100</c>, the request will
|
||||
/// be split into 5 individual requests; thus returning 5 individual asynchronous responses, hence the need
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -17,7 +17,7 @@ namespace Discord
|
||||
public string Label { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the placeholder of the component.
|
||||
/// Gets the placeholder of the component.
|
||||
/// </summary>
|
||||
public string Placeholder { get; }
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -161,11 +161,11 @@ namespace Discord
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to parse a string into an <see cref="EmbedBuilder"/>.
|
||||
/// Tries to parse a string into an <see cref="EmbedBuilder"/>.
|
||||
/// </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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Discord.Interactions.Builders
|
||||
/// <inheritdoc/>
|
||||
public ModuleBuilder Module { get; }
|
||||
|
||||
//// <inheritdoc/>
|
||||
/// <inheritdoc/>
|
||||
public ExecuteCallback Callback { get; internal set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 { }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -8,19 +8,19 @@ 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
|
||||
|
||||
internal static readonly byte[] _category = new byte[] {
|
||||
// 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
|
||||
// 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
|
||||
0,0,0,0,0,0,0,0,0,X,X,0,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
// ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
|
||||
// ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
|
||||
X,0,0,Z,S,0,0,0,S,S,Q,Q,0,0,S,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Q,
|
||||
// @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,S,S,0,S,0,
|
||||
// ' a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
|
||||
// ' a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Q,S,0,0,0};
|
||||
|
||||
internal static string EscapeExcluding(string input, params char[] exclude)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Discord.Rest
|
||||
public IReadOnlyCollection<IRouteSegmentMatch> SegmentMatches { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="RestInteractionContext{TInteraction}"/>.
|
||||
/// Initializes a new <see cref="RestInteractionContext{TInteraction}"/>.
|
||||
/// </summary>
|
||||
/// <param name="client">The underlying client.</param>
|
||||
/// <param name="interaction">The underlying interaction.</param>
|
||||
@@ -65,7 +65,7 @@ namespace Discord.Rest
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="RestInteractionContext{TInteraction}"/>.
|
||||
/// Initializes a new <see cref="RestInteractionContext{TInteraction}"/>.
|
||||
/// </summary>
|
||||
/// <param name="client">The underlying client.</param>
|
||||
/// <param name="interaction">The underlying interaction.</param>
|
||||
@@ -83,7 +83,7 @@ namespace Discord.Rest
|
||||
/// <inheritdoc/>
|
||||
IEnumerable<IRouteSegmentMatch> IRouteMatchContainer.SegmentMatches => SegmentMatches;
|
||||
|
||||
// IInterationContext
|
||||
// IInteractionContext
|
||||
/// <inheritdoc/>
|
||||
IDiscordClient IInteractionContext.Client => Client;
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace Discord.Net.ED25519
|
||||
{
|
||||
/// <summary>
|
||||
/// Comparison of two arrays.
|
||||
///
|
||||
///
|
||||
/// The runtime of this method does not depend on the contents of the arrays. Using constant time
|
||||
/// prevents timing attacks that allow an attacker to learn if the arrays have a common prefix.
|
||||
///
|
||||
///
|
||||
/// It is important to use such a constant time comparison when verifying MACs.
|
||||
/// </summary>
|
||||
/// <param name="x">Byte array</param>
|
||||
@@ -27,10 +27,10 @@ namespace Discord.Net.ED25519
|
||||
|
||||
/// <summary>
|
||||
/// Comparison of two array segments.
|
||||
///
|
||||
///
|
||||
/// The runtime of this method does not depend on the contents of the arrays. Using constant time
|
||||
/// prevents timing attacks that allow an attacker to learn if the arrays have a common prefix.
|
||||
///
|
||||
///
|
||||
/// It is important to use such a constant time comparison when verifying MACs.
|
||||
/// </summary>
|
||||
/// <param name="x">Byte array segment</param>
|
||||
@@ -45,17 +45,17 @@ namespace Discord.Net.ED25519
|
||||
|
||||
/// <summary>
|
||||
/// Comparison of two byte sequences.
|
||||
///
|
||||
///
|
||||
/// The runtime of this method does not depend on the contents of the arrays. Using constant time
|
||||
/// prevents timing attacks that allow an attacker to learn if the arrays have a common prefix.
|
||||
///
|
||||
///
|
||||
/// It is important to use such a constant time comparison when verifying MACs.
|
||||
/// </summary>
|
||||
/// <param name="x">Byte array</param>
|
||||
/// <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)
|
||||
{
|
||||
@@ -71,7 +71,7 @@ namespace Discord.Net.ED25519
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overwrites the contents of the array, wiping the previous content.
|
||||
/// Overwrites the contents of the array, wiping the previous content.
|
||||
/// </summary>
|
||||
/// <param name="data">Byte array</param>
|
||||
public static void Wipe(byte[] data)
|
||||
@@ -80,7 +80,7 @@ namespace Discord.Net.ED25519
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overwrites the contents of the array, wiping the previous content.
|
||||
/// Overwrites the contents of the array, wiping the previous content.
|
||||
/// </summary>
|
||||
/// <param name="data">Byte array</param>
|
||||
/// <param name="offset">Index of byte sequence</param>
|
||||
@@ -91,7 +91,7 @@ namespace Discord.Net.ED25519
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overwrites the contents of the array segment, wiping the previous content.
|
||||
/// Overwrites the contents of the array segment, wiping the previous content.
|
||||
/// </summary>
|
||||
/// <param name="data">Byte array segment</param>
|
||||
public static void Wipe(ArraySegment<byte> data)
|
||||
@@ -183,7 +183,7 @@ namespace Discord.Net.ED25519
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encodes the bytes with the Base64 encoding.
|
||||
/// Encodes the bytes with the Base64 encoding.
|
||||
/// More compact than hex, but it is case-sensitive and uses the special characters `+`, `/` and `=`.
|
||||
/// </summary>
|
||||
/// <param name="data">Byte array</param>
|
||||
@@ -247,7 +247,7 @@ namespace Discord.Net.ED25519
|
||||
/// <returns>Byte array</returns>
|
||||
public static byte[] Base58Decode(string input)
|
||||
{
|
||||
// Decode Base58 string to BigInteger
|
||||
// Decode Base58 string to BigInteger
|
||||
BigInteger intData = 0;
|
||||
for (int i = 0; i < input.Length; i++)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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>
|
||||
@@ -2128,7 +2128,7 @@ namespace Discord.WebSocket
|
||||
_audioLock?.Dispose();
|
||||
_audioClient?.Dispose();
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
async Task<IAutoModRule> IGuild.GetAutoModRuleAsync(ulong ruleId, RequestOptions options)
|
||||
=> await GetAutoModRuleAsync(ruleId, options).ConfigureAwait(false);
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Discord.Interactions
|
||||
public IReadOnlyCollection<IRouteSegmentMatch> SegmentMatches { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="SocketInteractionContext{TInteraction}"/>.
|
||||
/// Initializes a new <see cref="SocketInteractionContext{TInteraction}"/>.
|
||||
/// </summary>
|
||||
/// <param name="client">The underlying client.</param>
|
||||
/// <param name="interaction">The underlying interaction.</param>
|
||||
@@ -85,7 +85,7 @@ namespace Discord.Interactions
|
||||
public class SocketInteractionContext : SocketInteractionContext<SocketInteraction>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new <see cref="SocketInteractionContext"/>
|
||||
/// Initializes a new <see cref="SocketInteractionContext"/>
|
||||
/// </summary>
|
||||
/// <param name="client">The underlying client</param>
|
||||
/// <param name="interaction">The underlying interaction</param>
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user