Class CommandContext
Represents a context in which a command is executed.
Inheritance
Namespace: DSharpPlus.CommandsNext
Assembly: cs.temp.dll.dll
Syntax
public sealed class CommandContext
Properties
Channel
Gets the channel in which the execution was triggered,
Declaration
public DiscordChannel Channel { get; }
Property Value
Type | Description |
---|---|
DiscordChannel |
Client
Gets the client which received the message.
Declaration
public DiscordClient Client { get; }
Property Value
Type | Description |
---|---|
DiscordClient |
Command
Gets the command that is being executed.
Declaration
public Command Command { get; }
Property Value
Type | Description |
---|---|
Command |
CommandsNext
Gets the CommandsNext service instance that handled this command.
Declaration
public CommandsNextExtension CommandsNext { get; }
Property Value
Type | Description |
---|---|
CommandsNextExtension |
Guild
Gets the guild in which the execution was triggered. This property is null for commands sent over direct messages.
Declaration
public DiscordGuild Guild { get; }
Property Value
Type | Description |
---|---|
DiscordGuild |
Member
Gets the member who triggered the execution. This property is null for commands sent over direct messages.
Declaration
public DiscordMember Member { get; }
Property Value
Type | Description |
---|---|
DiscordMember |
Message
Gets the message that triggered the execution.
Declaration
public DiscordMessage Message { get; }
Property Value
Type | Description |
---|---|
DiscordMessage |
Overload
Gets the overload of the command that is being executed.
Declaration
public CommandOverload Overload { get; }
Property Value
Type | Description |
---|---|
CommandOverload |
Prefix
Gets the prefix used to invoke the command.
Declaration
public string Prefix { get; }
Property Value
Type | Description |
---|---|
System.String |
RawArguments
Gets the list of raw arguments passed to the command.
Declaration
public IReadOnlyList<string> RawArguments { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<System.String> |
RawArgumentString
Gets the raw string from which the arguments were extracted.
Declaration
public string RawArgumentString { get; }
Property Value
Type | Description |
---|---|
System.String |
Services
Gets the service provider for this CNext instance.
Declaration
public IServiceProvider Services { get; }
Property Value
Type | Description |
---|---|
IServiceProvider |
User
Gets the user who triggered the execution.
Declaration
public DiscordUser User { get; }
Property Value
Type | Description |
---|---|
DiscordUser |
Methods
RespondAsync(DiscordEmbed)
Quickly respond to the message that triggered the command.
Declaration
public Task<DiscordMessage> RespondAsync(DiscordEmbed embed)
Parameters
Type | Name | Description |
---|---|---|
DiscordEmbed | embed | Embed to attach. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
RespondAsync(DiscordMessageBuilder)
Quickly respond to the message that triggered the command.
Declaration
public Task<DiscordMessage> RespondAsync(DiscordMessageBuilder builder)
Parameters
Type | Name | Description |
---|---|---|
DiscordMessageBuilder | builder | The Discord Mesage builder. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
RespondAsync(String)
Quickly respond to the message that triggered the command.
Declaration
public Task<DiscordMessage> RespondAsync(string content)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | Message to respond with. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
RespondAsync(String, DiscordEmbed)
Quickly respond to the message that triggered the command.
Declaration
public Task<DiscordMessage> RespondAsync(string content, DiscordEmbed embed)
Parameters
Type | Name | Description |
---|---|---|
System.String | content | Message to respond with. |
DiscordEmbed | embed | Embed to attach. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<DiscordMessage> |
TriggerTypingAsync()
Triggers typing in the channel containing the message that triggered the command.
Declaration
public Task TriggerTypingAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |