Context

Context for operations used by command methods.

$(DPREF command, CommandSet) subtypes an instance of this type, allowing command methods to access the properties and methods of this type without any preceding qualification.

Some operations are synchronous, non-blocking operations; they may time a significant duration of time to complete, but they do not block the thread from handling other events, such as other command invocations.

Constructors

this
this(Context ctx, string target)

Create a new context from an existing one, but with a different originating channel/user.

Members

Functions

bot
Bot bot()

The current bot.

channel
TrackedChannel channel()

The channel the command was invoked in.

isPrivateMessage
bool isPrivateMessage()

Boolean whether or not the command was invoked from a private message.

network
IrcClient network()

The current network.

quit
void quit(in char[] msg)

Disconnect from the current network with the given message.

reply
void reply(in char[] fmt, FmtArgs fmtArgs)

Reply to the channel in which the command was invoked. If there is more than one argument, the first argument is formatted with subsequent ones.

user
const(IrcUser) user()

The user that invoked the command.

wait
void wait(double time)

Wait the given length of time before returning.

whois
WhoisResult whois(string nickName)

Lookup more information about the user for the given nick name.

Structs

WhoisResult
struct WhoisResult

Result of Context.whois.

Meta