Message

An IRC message, passed between clients.

Members

Functions

ctcpArgs
auto ctcpArgs()

The arguments after the CTCP command, if this is a CTCP message.

ctcpCommand
auto ctcpCommand()

The CTCP command, if this is a CTCP message.

isCTCP
auto isCTCP()

Whether or not the message was a CTCP message.

isReplyable
auto isReplyable()

Whether or not the message is safe to reply to.

opEquals
bool opEquals(string str)
Undocumented in source. Be warned that the author may not have intended to support it.
toHash
auto toHash()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

isEcho
bool isEcho;

Whether or not the message was the result of the server echoing back our messages.

msg
string msg;

This message's payload. Will include \x01 characters if the message is CTCP.

type
MessageType type;

Type of message.

Examples

{
	auto msg = Message("Hello!", MessageType.notice);
	assert(!msg.isCTCP);
	assert(!msg.isReplyable);
}
{
	auto msg = Message("Hello!", MessageType.privmsg);
	assert(msg.isReplyable);
}
{
	auto msg = Message("\x01ACTION does a thing\x01", MessageType.privmsg);
	assert(msg.isCTCP);
	assert(msg.ctcpCommand == "ACTION");
	assert(msg.ctcpArgs == "does a thing");
}
{
	auto msg = Message("\x01VERSION\x01", MessageType.privmsg);
	assert(msg.isCTCP);
	assert(msg.ctcpCommand == "VERSION");
	assert(msg.ctcpArgs == "");
}

Meta