mode

Sets a channel mode.

This includes modes that pertain to a user in the context of a channel, like bans.

void
mode
(,
const string channel
,
const const(char)[] modes
,
const string content = string.init
,,
const string caller = __FUNCTION__
)

Parameters

state IRCPluginState

The current plugin's IRCPluginState, via which to send messages to the server.

channel string

Channel to change the modes of.

modes const(char)[]

Mode characters to apply to the channel.

content string

Target of mode change, if applicable.

properties Message.Property

Custom message properties, such as Message.Property.quiet and Message.Property.forced.

caller string

String name of the calling function, or something else that gives context.

Examples

IRCPluginState state;
state.mainThread = thisTid;

mode(state, "#channel", "+o", "content");

receive(
    (Message m)
    {
        with (m.event)
        {
            assert((type == IRCEvent.Type.MODE), Enum!(IRCEvent.Type).toString(type));
            assert((channel == "#channel"), channel);
            assert((content == "content"), content);
            assert((aux[0] == "+o"), aux[0]);
            assert(m.properties == Message.Property.init);
        }
    }
);

Meta