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
|
## 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
|
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
|
## 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).
|
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.
|
The difference between these 3 functions is in how you handle the command response.
|
||||||
[RespondAsync] and
|
[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.
|
DeferAsync will not send out a response, RespondAsync will.
|
||||||
[FollowupAsync] follows up on succesful acknowledgement.
|
[FollowupAsync] follows up on successful acknowledgement.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!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
|
[RespondAsync]: xref:Discord.IDiscordInteraction
|
||||||
[DeferAsync]: xref:Discord.IDiscordInteraction
|
[DeferAsync]: xref:Discord.IDiscordInteraction
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Ratelimits
|
# 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
|
### Using the ratelimit callback
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ Injecting through properties is also allowed as follows.
|
|||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
> Dependency Injection will not resolve missing services in property injection, and it will not pick a constructor instead.
|
> 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
|
## Using the provider itself
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
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.
|
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
|
## 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 **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.
|
* A **Message Command** ([IMessageCommandInteraction]) is an application command targeting a message.
|
||||||
* An **User Command** ([IUserCommandInteraction]) is an application command targetting a user.
|
* An **User Command** ([IUserCommandInteraction]) is an application command targeting a user.
|
||||||
* An **Application Command** ([IApplicationCommandInteraction]) is any of the above.
|
* 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.
|
* 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.
|
* 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");
|
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
|
||||||
|
|
||||||
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
|
## Getting started with guild events
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ title: Modifying Guild Events
|
|||||||
|
|
||||||
# Modifying 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 |
|
| Name | Type | Description |
|
||||||
| ------------ | --------------------------------- | -------------------------------------------- |
|
| ------------ | --------------------------------- | -------------------------------------------- |
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ By default, your methods can feature the following parameter types:
|
|||||||
| `IVoiceChannel` | Voice Channels |
|
| `IVoiceChannel` | Voice Channels |
|
||||||
| `IDMChannel` | DM Channels |
|
| `IDMChannel` | DM Channels |
|
||||||
| `IGroupChannel` | Group Channels |
|
| `IGroupChannel` | Group Channels |
|
||||||
| `ICategory Channel` | Category Channels |
|
| `ICategoryChannel` | Category Channels |
|
||||||
| `INewsChannel` | News Channels |
|
| `INewsChannel` | News Channels |
|
||||||
| `IThreadChannel` | Public, Private, News Threads |
|
| `IThreadChannel` | Public, Private, News Threads |
|
||||||
| `ITextChannel` | Text Channels |
|
| `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.
|
You may use as many wild card characters as you want.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!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*
|
> `op` will be *play* and `name` will be *rickroll*
|
||||||
|
|
||||||
## Select Menus
|
## Select Menus
|
||||||
@@ -262,7 +262,7 @@ One problem with using the concrete type InteractionContexts is that you cannot
|
|||||||
|
|
||||||
> [!INFO]
|
> [!INFO]
|
||||||
> Message component interactions have access to a special method called `UpdateAsync()` to update the body of the method the interaction originated from.
|
> 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)]
|
[!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.
|
By nesting commands inside a module that is tagged with [GroupAttribute] you can create prefixed commands.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!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.
|
> you are not permitted to use more than 2 [GroupAttribute]'s in module hierarchy.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!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)]
|
[!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.
|
This behaviour can be configured by changing the `RunMode` property of `InteractionServiceConfig` or by setting the *runMode* parameter of a command attribute.
|
||||||
|
|
||||||
> [!WARNING]
|
> [!WARNING]
|
||||||
@@ -354,12 +354,12 @@ can be used to register cherry picked modules or commands to global/guild scopes
|
|||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> In debug environment, since Global commands can take up to 1 hour to register/update,
|
> 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.
|
> You can use preprocessor directives to create a simple logic for registering commands as seen above.
|
||||||
|
|
||||||
## Interaction Utility
|
## 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.
|
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.
|
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.
|
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
|
## 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
|
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:
|
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]
|
> [!NOTE]
|
||||||
> You can either use the [IResult.Error] property of an Interaction result or create type check for the
|
> 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
|
[AutocompletionResult]: xref:Discord.AutocompleteResult
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ command parser.
|
|||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> The 'Message Content' intent, required for text commands, is now a
|
> 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
|
> 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)
|
> 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`
|
when developing on .NET Core, this is where you execute `dotnet run`
|
||||||
from; typically the same directory as your csproj).
|
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.**
|
**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
|
public sealed class LoadedOverride
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the aseembly containing the overrides definition.
|
/// Gets the assembly containing the overrides definition.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Assembly Assembly { get; internal set; }
|
public Assembly Assembly { get; internal set; }
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ namespace Discord
|
|||||||
/// Gets details about a specific override.
|
/// Gets details about a specific override.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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>
|
/// </remarks>
|
||||||
/// <param name="name">The name of the override to get.</param>
|
/// <param name="name">The name of the override to get.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
@@ -147,12 +147,12 @@ namespace Discord
|
|||||||
/// Adds an override to the current Discord.Net instance.
|
/// Adds an override to the current Discord.Net instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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.
|
/// the overrides initialization procedure will be sent in the <see cref="Log"/> event.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="name">The name of the override to add.</param>
|
/// <param name="name">The name of the override to add.</param>
|
||||||
/// <returns>
|
/// <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.
|
/// determining if the add operation was successful.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static async Task<bool> AddOverrideAsync(string name)
|
public static async Task<bool> AddOverrideAsync(string name)
|
||||||
@@ -169,12 +169,12 @@ namespace Discord
|
|||||||
/// Adds an override to the current Discord.Net instance.
|
/// Adds an override to the current Discord.Net instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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.
|
/// the overrides initialization procedure will be sent in the <see cref="Log"/> event.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="ovrride">The override to add.</param>
|
/// <param name="ovrride">The override to add.</param>
|
||||||
/// <returns>
|
/// <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.
|
/// determining if the add operation was successful.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static async Task<bool> AddOverrideAsync(Override ovrride)
|
public static async Task<bool> AddOverrideAsync(Override ovrride)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Discord.Overrides
|
namespace Discord.Overrides
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public sealed class OverrideContext
|
public sealed class OverrideContext
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace BasicBot
|
|||||||
|
|
||||||
if (message.Content == "!ping")
|
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()
|
var cb = new ComponentBuilder()
|
||||||
.WithButton("Click me!", "unique-id", ButtonStyle.Primary);
|
.WithButton("Click me!", "unique-id", ButtonStyle.Primary);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace InteractionFramework.Modules
|
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>
|
public class ExampleModule : InteractionModuleBase<SocketInteractionContext>
|
||||||
{
|
{
|
||||||
// Dependencies can be accessed through Property injection, public properties with public setters will be set by the service provider
|
// 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);
|
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);
|
await _commandExecutedEvent.InvokeAsync(matchResult.Match.Value.Command, context, executeResult);
|
||||||
return executeResult;
|
return executeResult;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,19 +17,19 @@ namespace Discord.Commands
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Executed asynchronously before a command is run in this module base.
|
/// Executed asynchronously before a command is run in this module base.
|
||||||
/// </summary>
|
/// </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);
|
Task BeforeExecuteAsync(CommandInfo command);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Executed before a command is run in this module base.
|
/// Executed before a command is run in this module base.
|
||||||
/// </summary>
|
/// </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);
|
void BeforeExecute(CommandInfo command);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Executed asynchronously after a command is run in this module base.
|
/// Executed asynchronously after a command is run in this module base.
|
||||||
/// </summary>
|
/// </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);
|
Task AfterExecuteAsync(CommandInfo command);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -194,7 +194,7 @@ namespace Discord
|
|||||||
public bool UseSystemClock { get; set; } = true;
|
public bool UseSystemClock { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <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.
|
/// + snowflake date to check if an interaction can be responded to.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ namespace Discord
|
|||||||
/// <summary> No messages will be scanned. </summary>
|
/// <summary> No messages will be scanned. </summary>
|
||||||
Disabled = 0,
|
Disabled = 0,
|
||||||
/// <summary> Scans messages from all guild members that do not have a role. </summary>
|
/// <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,
|
MembersWithoutRoles = 1,
|
||||||
/// <summary> Scan messages sent by all guild members. </summary>
|
/// <summary> Scan messages sent by all guild members. </summary>
|
||||||
AllMembers = 2
|
AllMembers = 2
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Discord
|
|||||||
/// Gets the description of the event.
|
/// Gets the description of the event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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>
|
/// </remarks>
|
||||||
string Description { get; }
|
string Description { get; }
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ namespace Discord
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the optional entity id of the event. The "entity" of the event
|
/// 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>
|
/// </summary>
|
||||||
ulong? EntityId { get; }
|
ulong? EntityId { get; }
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ namespace Discord
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
Task StartAsync(RequestOptions options = null);
|
Task StartAsync(RequestOptions options = null);
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ends or canceles the event.
|
/// Ends or cancels the event.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace Discord
|
namespace Discord
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Respresents a <see cref="IMessageComponent"/> text input.
|
/// Represents a <see cref="IMessageComponent"/> text input.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TextInputComponent : IMessageComponent
|
public class TextInputComponent : IMessageComponent
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Discord
|
|||||||
internal override ApplicationCommandType Type => ApplicationCommandType.Slash;
|
internal override ApplicationCommandType Type => ApplicationCommandType.Slash;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the discription of this command.
|
/// Gets or sets the description of this command.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Optional<string> Description { get; set; }
|
public Optional<string> Description { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ namespace Discord
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="json">The json string to parse.</param>
|
/// <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>
|
/// <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)
|
public static bool TryParse(string json, out EmbedBuilder builder)
|
||||||
{
|
{
|
||||||
builder = new EmbedBuilder();
|
builder = new EmbedBuilder();
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace Discord
|
|||||||
/// <param name="guildId">Id of the target guild.</param>
|
/// <param name="guildId">Id of the target guild.</param>
|
||||||
/// <param name="allow">The value of this permission.</param>
|
/// <param name="allow">The value of this permission.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Instance of <see cref="ApplicationCommandPermission"/> targeting everychannel in a guild.
|
/// Instance of <see cref="ApplicationCommandPermission"/> targeting every channel in a guild.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static ApplicationCommandPermission ForAllChannels(ulong guildId, bool allow) =>
|
public static ApplicationCommandPermission ForAllChannels(ulong guildId, bool allow) =>
|
||||||
new(guildId - 1, ApplicationCommandPermissionTarget.Channel, allow);
|
new(guildId - 1, ApplicationCommandPermissionTarget.Channel, allow);
|
||||||
@@ -110,7 +110,7 @@ namespace Discord
|
|||||||
/// <param name="guild">Target guild.</param>
|
/// <param name="guild">Target guild.</param>
|
||||||
/// <param name="allow">The value of this permission.</param>
|
/// <param name="allow">The value of this permission.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// Instance of <see cref="ApplicationCommandPermission"/> targeting everychannel in a guild.
|
/// Instance of <see cref="ApplicationCommandPermission"/> targeting every channel in a guild.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static ApplicationCommandPermission ForAllChannels(IGuild guild, bool allow) =>
|
public static ApplicationCommandPermission ForAllChannels(IGuild guild, bool allow) =>
|
||||||
ForAllChannels(guild.Id, allow);
|
ForAllChannels(guild.Id, allow);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Discord
|
|||||||
/// </returns>
|
/// </returns>
|
||||||
bool? IsRevoked { get; }
|
bool? IsRevoked { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a <see cref="IReadOnlyCollection{T}"/> of integration parials.
|
/// Gets a <see cref="IReadOnlyCollection{T}"/> of integration partials.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
IReadOnlyCollection<IIntegration> Integrations { get; }
|
IReadOnlyCollection<IIntegration> Integrations { get; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ namespace Discord
|
|||||||
/// Formats a user's username + discriminator.
|
/// Formats a user's username + discriminator.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="doBidirectional">To format the string in bidirectional unicode or not</param>
|
/// <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>
|
/// <returns>The username + discriminator</returns>
|
||||||
public static string UsernameAndDiscriminator(IUser user, bool doBidirectional)
|
public static string UsernameAndDiscriminator(IUser user, bool doBidirectional)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Discord.Interactions
|
|||||||
public bool IsRequired { get; }
|
public bool IsRequired { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the input as required or optinal.
|
/// Sets the input as required or optional.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="isRequired">Whether or not user input is required for this input.</param>
|
/// <param name="isRequired">Whether or not user input is required for this input.</param>
|
||||||
public RequiredInputAttribute(bool isRequired = true)
|
public RequiredInputAttribute(bool isRequired = true)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Discord.Interactions.Builders
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ModuleBuilder Module { get; }
|
public ModuleBuilder Module { get; }
|
||||||
|
|
||||||
//// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public ExecuteCallback Callback { get; internal set; }
|
public ExecuteCallback Callback { get; internal set; }
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Discord.Interactions.Builders
|
|||||||
bool IsParameterArray { get; }
|
bool IsParameterArray { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the deafult value of this parameter.
|
/// Gets the default value of this parameter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
object DefaultValue { get; }
|
object DefaultValue { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Discord.Interactions
|
|||||||
bool IgnoreGroupNames { get; }
|
bool IgnoreGroupNames { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets wheter this command supports wild card patterns.
|
/// Gets whether this command supports wild card patterns.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool SupportsWildCards { get; }
|
bool SupportsWildCards { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ namespace Discord.Interactions
|
|||||||
/// Creates an <see cref="IModal"/> and fills it with provided message components.
|
/// Creates an <see cref="IModal"/> and fills it with provided message components.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">Context of the <see cref="IModalInteraction"/> that will be injected into the modal.</param>
|
/// <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="services">Services to be passed onto the <see cref="ComponentTypeConverter"/>s of the modal fields.</param>
|
||||||
/// <param name="throwOnMissingField">Wheter or not this method should exit on encountering a missing modal field.</param>
|
/// <param name="throwOnMissingField">Whether or not this method should exit on encountering a missing modal field.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// A <see cref="TypeConverterResult"/> if a type conversion has failed, else a <see cref="ParseResult"/>.
|
/// A <see cref="TypeConverterResult"/> if a type conversion has failed, else a <see cref="ParseResult"/>.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Discord.Interactions
|
|||||||
public double? MinValue { get; }
|
public double? MinValue { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the maxmimum value permitted for a number type parameter.
|
/// Gets the maximum value permitted for a number type parameter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public double? MaxValue { get; }
|
public double? MaxValue { get; }
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ namespace Discord.Interactions
|
|||||||
public TypeConverter TypeConverter { get; }
|
public TypeConverter TypeConverter { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="IAutocompleteHandler"/> thats linked to this parameter.
|
/// Gets the <see cref="IAutocompleteHandler"/> that's linked to this parameter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public IAutocompleteHandler AutocompleteHandler { get; }
|
public IAutocompleteHandler AutocompleteHandler { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Discord.Interactions
|
|||||||
public class InteractionService : IDisposable
|
public class InteractionService : IDisposable
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Occurs when a Slash Command related information is recieved.
|
/// Occurs when a Slash Command related information is received.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Func<LogMessage, Task> Log { add { _logEvent.Add(value); } remove { _logEvent.Remove(value); } }
|
public event Func<LogMessage, Task> Log { add { _logEvent.Add(value); } remove { _logEvent.Remove(value); } }
|
||||||
internal readonly AsyncEvent<Func<LogMessage, Task>> _logEvent = new();
|
internal readonly AsyncEvent<Func<LogMessage, Task>> _logEvent = new();
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Discord.Interactions
|
|||||||
public bool ThrowOnError { get; set; } = true;
|
public bool ThrowOnError { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public char[] InteractionCustomIdDelimiters { get; set; }
|
public char[] InteractionCustomIdDelimiters { get; set; }
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ namespace Discord.Interactions
|
|||||||
public bool EnableAutocompleteHandlers { get; set; } = true;
|
public bool EnableAutocompleteHandlers { get; set; } = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public bool AutoServiceScopes { get; set; } = true;
|
public bool AutoServiceScopes { get; set; } = true;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Discord.Interactions
|
namespace Discord.Interactions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Respresents a localization provider for Discord Application Commands.
|
/// Represents a localization provider for Discord Application Commands.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface ILocalizationManager
|
public interface ILocalizationManager
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace Discord.Interactions
|
|||||||
public struct TypeConverterResult : IResult
|
public struct TypeConverterResult : IResult
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the result of the convertion if the operation was successful.
|
/// Gets the result of the conversion if the operation was successful.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object Value { get; }
|
public object Value { get; }
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ namespace Discord.Interactions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns a <see cref="TypeConverterResult" /> with <see cref="InteractionCommandError.Exception" /> and the <see cref="Exception.Message"/>.
|
/// Returns a <see cref="TypeConverterResult" /> with <see cref="InteractionCommandError.Exception" /> and the <see cref="Exception.Message"/>.
|
||||||
/// </summary>
|
/// </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) =>
|
public static TypeConverterResult FromError(Exception exception) =>
|
||||||
new TypeConverterResult(null, InteractionCommandError.Exception, exception.Message);
|
new TypeConverterResult(null, InteractionCommandError.Exception, exception.Message);
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ namespace Discord.Interactions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Will be used to read the incoming payload before executing the method body.
|
/// Will be used to read the incoming payload before executing the method body.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">Command exexution context.</param>
|
/// <param name="context">Command execution context.</param>
|
||||||
/// <param name="option">Recieved option payload.</param>
|
/// <param name="option">Received option payload.</param>
|
||||||
/// <param name="services">Service provider that will be used to initialize the command module.</param>
|
/// <param name="services">Service provider that will be used to initialize the command module.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
/// The result of the read process.
|
/// 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
|
/// Enum values tagged with this attribute will not be displayed as a parameter choice
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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>
|
/// </remarks>
|
||||||
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
|
||||||
public sealed class HideAttribute : Attribute { }
|
public sealed class HideAttribute : Attribute { }
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ namespace Discord.Interactions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Will be used to read the incoming payload before executing the method body.
|
/// Will be used to read the incoming payload before executing the method body.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="context">Command exexution context.</param>
|
/// <param name="context">Command execution context.</param>
|
||||||
/// <param name="option">Recieved option payload.</param>
|
/// <param name="option">Received option payload.</param>
|
||||||
/// <param name="services">Service provider that will be used to initialize the command module.</param>
|
/// <param name="services">Service provider that will be used to initialize the command module.</param>
|
||||||
/// <returns>The result of the read process.</returns>
|
/// <returns>The result of the read process.</returns>
|
||||||
public abstract Task<TypeConverterResult> ReadAsync(IInteractionContext context, IApplicationCommandInteractionDataOption option, IServiceProvider services);
|
public abstract Task<TypeConverterResult> ReadAsync(IInteractionContext context, IApplicationCommandInteractionDataOption option, IServiceProvider services);
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ namespace Discord.Interactions
|
|||||||
public static class InteractionUtility
|
public static class InteractionUtility
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="client">Client that should be listened to for the <see cref="BaseSocketClient.InteractionCreated"/> event.</param>
|
/// <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="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>
|
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
|
||||||
/// <returns>
|
/// <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"/>.
|
/// otherwise the Task result is <see langword="null"/>.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static async Task<SocketInteraction> WaitForInteractionAsync(BaseSocketClient client, TimeSpan timeout,
|
public static async Task<SocketInteraction> WaitForInteractionAsync(BaseSocketClient client, TimeSpan timeout,
|
||||||
@@ -55,14 +55,14 @@ namespace Discord.Interactions
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="client">Client that should be listened to for the <see cref="BaseSocketClient.InteractionCreated"/> event.</param>
|
/// <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="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="timeout">Timeout duration for this operation.</param>
|
||||||
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
|
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
|
||||||
/// <returns>
|
/// <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.
|
/// the result is null if the process timed out before receiving a valid Interaction.
|
||||||
/// </returns>
|
/// </returns>
|
||||||
public static Task<SocketInteraction> WaitForMessageComponentAsync(BaseSocketClient client, IUserMessage fromMessage, TimeSpan timeout,
|
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="message">Optional custom prompt message.</param>
|
||||||
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
|
/// <param name="cancellationToken">Token for canceling the wait operation.</param>
|
||||||
/// <returns>
|
/// <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.
|
/// 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>
|
/// </returns>
|
||||||
public static async Task<bool> ConfirmAsync(BaseSocketClient client, IMessageChannel channel, TimeSpan timeout, string message = null,
|
public static async Task<bool> ConfirmAsync(BaseSocketClient client, IMessageChannel channel, TimeSpan timeout, string message = null,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ namespace System.Text.RegularExpressions
|
|||||||
internal static class RegexUtils
|
internal static class RegexUtils
|
||||||
{
|
{
|
||||||
internal const byte Q = 5; // quantifier
|
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 Z = 3; // ScanBlank stopper
|
||||||
internal const byte X = 2; // whitespace
|
internal const byte X = 2; // whitespace
|
||||||
internal const byte E = 1; // should be escaped
|
internal const byte E = 1; // should be escaped
|
||||||
|
|||||||
@@ -2328,7 +2328,7 @@ namespace Discord.API
|
|||||||
.Append(args.ActionType.Value);
|
.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()}";
|
endpoint = () => $"guilds/{guildId}/audit-logs?limit={limit}{queryArgs.ToString()}";
|
||||||
return await SendAsync<AuditLog>("GET", endpoint, ids, options: options).ConfigureAwait(false);
|
return await SendAsync<AuditLog>("GET", endpoint, ids, options: options).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using Model = Discord.API.AuditLog;
|
|||||||
namespace Discord.Rest
|
namespace Discord.Rest
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
public class ScheduledEventDeleteAuditLogData : IAuditLogData
|
public class ScheduledEventDeleteAuditLogData : IAuditLogData
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Discord.Rest
|
|||||||
public RestUser User { get; }
|
public RestUser User { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="RestInteraction"/> the command was recieved with.
|
/// Gets the <see cref="RestInteraction"/> the command was received with.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TInteraction Interaction { get; }
|
public TInteraction Interaction { get; }
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ namespace Discord.Rest
|
|||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
IEnumerable<IRouteSegmentMatch> IRouteMatchContainer.SegmentMatches => SegmentMatches;
|
IEnumerable<IRouteSegmentMatch> IRouteMatchContainer.SegmentMatches => SegmentMatches;
|
||||||
|
|
||||||
// IInterationContext
|
// IInteractionContext
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
IDiscordClient IInteractionContext.Client => Client;
|
IDiscordClient IInteractionContext.Client => Client;
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Discord.Net.ED25519
|
|||||||
/// <param name="xOffset">Offset of byte sequence in the x array</param>
|
/// <param name="xOffset">Offset of byte sequence in the x array</param>
|
||||||
/// <param name="y">Byte array</param>
|
/// <param name="y">Byte array</param>
|
||||||
/// <param name="yOffset">Offset of byte sequence in the y 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>
|
/// <returns>True if sequences are equal</returns>
|
||||||
public static bool ConstantTimeEquals(byte[] x, int xOffset, byte[] y, int yOffset, int length)
|
public static bool ConstantTimeEquals(byte[] x, int xOffset, byte[] y, int yOffset, int length)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2382,7 +2382,7 @@ namespace Discord.WebSocket
|
|||||||
channel = CreateDMChannel(data.ChannelId.Value, user, State);
|
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)
|
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.
|
/// Gets or sets whether or not the client should download the default stickers on startup.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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"/>.
|
/// This will make all default stickers have the type of <see cref="SocketUnknownSticker"/>.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
public bool AlwaysDownloadDefaultStickers { get; set; } = false;
|
public bool AlwaysDownloadDefaultStickers { get; set; } = false;
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ namespace Discord.WebSocket
|
|||||||
/// <returns>A task representing the download operation.</returns>
|
/// <returns>A task representing the download operation.</returns>
|
||||||
public async Task<IReadOnlyCollection<SocketThreadUser>> GetUsersAsync(RequestOptions options = null)
|
public async Task<IReadOnlyCollection<SocketThreadUser>> GetUsersAsync(RequestOptions options = null)
|
||||||
{
|
{
|
||||||
// download all users if we havent
|
// download all users if we haven't
|
||||||
if (!_usersDownloaded)
|
if (!_usersDownloaded)
|
||||||
{
|
{
|
||||||
await DownloadUsersAsync(options);
|
await DownloadUsersAsync(options);
|
||||||
|
|||||||
@@ -1212,7 +1212,7 @@ namespace Discord.WebSocket
|
|||||||
/// Gets a collection of all users in this guild.
|
/// Gets a collection of all users in this guild.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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>
|
/// <para>Users returned by this method are not cached.</para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="options">The options to be used when sending the request.</param>
|
/// <param name="options">The options to be used when sending the request.</param>
|
||||||
|
|||||||
@@ -401,7 +401,7 @@ namespace Discord.WebSocket
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Attepts to get the channel this interaction was executed in.
|
/// Attempts to get the channel this interaction was executed in.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="options">The request options for this <see langword="async"/> request.</param>
|
/// <param name="options">The request options for this <see langword="async"/> request.</param>
|
||||||
/// <returns>
|
/// <returns>
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Discord.Interactions
|
|||||||
public SocketUser User { get; }
|
public SocketUser User { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the <see cref="SocketInteraction"/> the command was recieved with.
|
/// Gets the <see cref="SocketInteraction"/> the command was received with.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public TInteraction Interaction { get; }
|
public TInteraction Interaction { get; }
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace TestHelper
|
|||||||
#region Get Diagnostics
|
#region Get Diagnostics
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Given classes in the form of strings, their language, and an IDiagnosticAnlayzer to apply to it, return the diagnostics found in the string after converting it to a document.
|
/// Given classes in the form of strings, their language, and an IDiagnosticAnalyzer to apply to it, return the diagnostics found in the string after converting it to a document.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sources">Classes in the form of strings.</param>
|
/// <param name="sources">Classes in the form of strings.</param>
|
||||||
/// <param name="language">The language the source classes are in.</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>
|
/// <summary>
|
||||||
/// Tests that valid url's do not throw any exceptions.
|
/// Tests that valid url does not throw any exceptions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="url">The url to set.</param>
|
/// <param name="url">The url to set.</param>
|
||||||
[Theory]
|
[Theory]
|
||||||
|
|||||||
Reference in New Issue
Block a user