Show / Hide Table of Contents

Class SocketCommandContext

Represents a WebSocket-based context of a command. This may include the client, guild, channel, user, and message.

Inheritance
System.Object
SocketCommandContext
ShardedCommandContext
Implements
ICommandContext
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord.Commands
Assembly: Discord.Net.WebSocket.dll
Syntax
public class SocketCommandContext : ICommandContext

Constructors

| Improve this Doc View Source

SocketCommandContext(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 Source

Channel

Gets the ISocketMessageChannel that the command is executed in.

Declaration
public ISocketMessageChannel Channel { get; }
Property Value
Type Description
ISocketMessageChannel
| Improve this Doc View Source

Client

Gets the DiscordSocketClient that the command is executed with.

Declaration
public DiscordSocketClient Client { get; }
Property Value
Type Description
DiscordSocketClient
| Improve this Doc View Source

Guild

Gets the SocketGuild that the command is executed in.

Declaration
public SocketGuild Guild { get; }
Property Value
Type Description
SocketGuild
| Improve this Doc View Source

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
| Improve this Doc View Source

Message

Gets the SocketUserMessage that the command is interpreted from.

Declaration
public SocketUserMessage Message { get; }
Property Value
Type Description
SocketUserMessage
| Improve this Doc View Source

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 Source

ICommandContext.Channel

Gets the IMessageChannel that the command is executed in.

Declaration
IMessageChannel ICommandContext.Channel { get; }
Returns
Type Description
IMessageChannel
| Improve this Doc View Source

ICommandContext.Client

Gets the IDiscordClient that the command is executed with.

Declaration
IDiscordClient ICommandContext.Client { get; }
Returns
Type Description
IDiscordClient
| Improve this Doc View Source

ICommandContext.Guild

Gets the IGuild that the command is executed in.

Declaration
IGuild ICommandContext.Guild { get; }
Returns
Type Description
IGuild
| Improve this Doc View Source

ICommandContext.Message

Gets the IUserMessage that the command is interpreted from.

Declaration
IUserMessage ICommandContext.Message { get; }
Returns
Type Description
IUserMessage
| Improve this Doc View Source

ICommandContext.User

Gets the IUser who executed the command.

Declaration
IUser ICommandContext.User { get; }
Returns
Type Description
IUser

Implements

ICommandContext
  • Improve this Doc
  • View Source
Back to top Generated by DocFX