Class SocketCommandContext
Represents a WebSocket-based context of a command. This may include the client, guild, channel, user, and message.
Implements
Inherited Members
Namespace: Discord.Commands
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketCommandContext : ICommandContext
Constructors
| Improve this Doc View SourceSocketCommandContext(DiscordSocketClient, SocketUserMessage)
Initializes a new SocketCommandContext class with the provided client and message.
Declaration
public SocketCommandContext(DiscordSocketClient client, SocketUserMessage msg)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscordSocketClient | client | The underlying client. |
| SocketUserMessage | msg | The underlying message. |
Properties
| Improve this Doc View SourceChannel
Gets the ISocketMessageChannel that the command is executed in.
Declaration
public ISocketMessageChannel Channel { get; }
Property Value
| Type | Description |
|---|---|
| ISocketMessageChannel |
Client
Gets the DiscordSocketClient that the command is executed with.
Declaration
public DiscordSocketClient Client { get; }
Property Value
| Type | Description |
|---|---|
| DiscordSocketClient |
Guild
Gets the SocketGuild that the command is executed in.
Declaration
public SocketGuild Guild { get; }
Property Value
| Type | Description |
|---|---|
| SocketGuild |
IsPrivate
Indicates whether the channel that the command is executed in is a private channel.
Declaration
public bool IsPrivate { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Message
Gets the SocketUserMessage that the command is interpreted from.
Declaration
public SocketUserMessage Message { get; }
Property Value
| Type | Description |
|---|---|
| SocketUserMessage |
User
Gets the SocketUser who executed the command.
Declaration
public SocketUser User { get; }
Property Value
| Type | Description |
|---|---|
| SocketUser |
Explicit Interface Implementations
| Improve this Doc View SourceICommandContext.Channel
Gets the IMessageChannel that the command is executed in.
Declaration
IMessageChannel ICommandContext.Channel { get; }
Returns
| Type | Description |
|---|---|
| IMessageChannel |
ICommandContext.Client
Gets the IDiscordClient that the command is executed with.
Declaration
IDiscordClient ICommandContext.Client { get; }
Returns
| Type | Description |
|---|---|
| IDiscordClient |
ICommandContext.Guild
Gets the IGuild that the command is executed in.
Declaration
IGuild ICommandContext.Guild { get; }
Returns
| Type | Description |
|---|---|
| IGuild |
ICommandContext.Message
Gets the IUserMessage that the command is interpreted from.
Declaration
IUserMessage ICommandContext.Message { get; }
Returns
| Type | Description |
|---|---|
| IUserMessage |
ICommandContext.User
Gets the IUser who executed the command.
Declaration
IUser ICommandContext.User { get; }
Returns
| Type | Description |
|---|---|
| IUser |