Method ExecuteAsync
- Namespace
- DSharpPlus.Commands
- Assembly
- DSharpPlus.Commands.dll
ExecuteAsync(CommandContext, CancellationToken)
This method will ensure that the command is executable, execute all context checks, and then execute the command, and invoke the appropriate events.
public virtual ValueTask ExecuteAsync(CommandContext context, CancellationToken cancellationToken = default)
Parameters
context
CommandContextThe context of the command being executed.
cancellationToken
CancellationTokenThe cancellation token to cancel the command execution.
Returns
- ValueTask
Remarks
If any exceptions caused by the command were to occur, they will be delegated to the CommandErrored event.