Table of Contents

Class CommandContext

Namespace
Kook.Commands
Assembly
Kook.Net.Commands.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class CommandContext : ICommandContext
Inheritance
CommandContext
Implements
Inherited Members

Constructors

CommandContext(IKookClient, IUserMessage)

初始化一个包含指定客户端和消息的 CommandContext 类的新实例。

public CommandContext(IKookClient client, IUserMessage msg)

Parameters

client IKookClient

命令执行时所使用的客户端。

msg IUserMessage

命令解析的源消息。

Properties

Channel

获取命令执行所在的 IMessageChannel

public IMessageChannel Channel { get; }

Property Value

IMessageChannel

Client

获取命令执行时所使用的 IKookClient

public IKookClient Client { get; }

Property Value

IKookClient

Guild

获取命令执行所在的 IGuild

public IGuild? Guild { get; }

Property Value

IGuild

IsPrivate

获取当前上下文是否为私有的执行上下文。

public bool IsPrivate { get; }

Property Value

bool

Message

获取命令解析的源 IUserMessage

public IUserMessage Message { get; }

Property Value

IUserMessage

User

获取执行命令的 IUser

public IUser User { get; }

Property Value

IUser