reply

Replies to a message in a Twitch channel. Requires version TwitchSupport, without which it will just pass on to chan.

If an IRCEvent of type QUERY is passed *and* we're connected to a Twitch server *and* the TwitchPlugin is compiled in, it will send a bus message to have the reply be sent as a whisper instead.

void
reply
(,
const ref IRCEvent event
,
const string content
,,
const string caller = __FUNCTION__
)

Parameters

state IRCPluginState

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

event IRCEvent

Original event, to which we're replying.

content string

Message body content to send.

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.server.daemon = IRCServer.Daemon.twitch;

IRCEvent event;
event.type = IRCEvent.Type.CHAN;
event.sender.nickname = "kameloso";
event.channel = "#channel";
event.content = "content";
event.id = "some-reply-id";

reply(state, event, "reply content");

immutable m = state.outgoingMessages.data[0];
with (m.event)
{
    assert((type == IRCEvent.Type.CHAN), Enum!(IRCEvent.Type).toString(type));
    assert((content == "reply content"), content);
    assert((tags == "reply-parent-msg-id=some-reply-id"), tags);
    assert((m.properties == Message.Property.init));
}