Contents

Chatbots & IRC: 
Twitch IRC Capability: Miscellaneous Commands

Overview

This guide explains the Twitch IRC miscellaneous command capabilities.

Command Description
CLEARCHAT Purge a user’s message(s), typically after a user is banned from chat or timed out.
CLEARMSG Single message removal on a channel. This is triggered via /delete <target-msg-id> on IRC.
HOSTTARGET Channel starts or stops host mode.
NOTICE General notices from the server.
RECONNECT Rejoin channels after a restart.
ROOMSTATE Identifies the channel’s chat settings (e.g., slow mode duration).
USERNOTICE Announces Twitch-specific events to the channel (e.g., a user’s subscription notification).
USERSTATE Identifies a user’s chat settings or properties (e.g., chat color).

CLEARCHAT (Twitch Commands)

Purge a user’s message(s), typically after a user is banned from chat or timed out.

Prototype:

> :tmi.twitch.tv CLEARCHAT #<channel> :<user>

Use with the tags capability; see CLEARCHAT (Twitch Tags), which has additional parameters.  If your IRC bot plans to read commands, it must also use the tags capability because most commands are less useful or even meaningless without tags. See CLEARCHAT (Twitch Tags), which has additional parameters.

Example 1: Clear (delete) all chat on the dallas channel.

> :tmi.twitch.tv CLEARCHAT #dallas

Example 2: Clear (delete) all chat from a single user on the dallas channel.

> :tmi.twitch.tv CLEARCHAT #dallas :ronni

CLEARMSG (Twitch Commands)

Single message removal on a channel. This is triggered via /delete <target-msg-id> on IRC. Use with the tags capability; see CLEARMSG (Twitch Tags).

Prototype:

> @login=<login>;target-msg-id=<target-msg-id> :tmi.twitch.tv CLEARMSG #<channel> :<message>
ParameterDescription
loginName of the user who sent the message.
messageThe message.
target-msg-idUUID of the message.

Example: ronni’s HeyGuys message is deleted from the dallas channel.

> @login=ronni;target-msg-id=abc-123-def :tmi.twitch.tv CLEARMSG #dallas :HeyGuys

HOSTTARGET (Twitch Commands)

Channel starts or stops host mode.

Channel starts host mode:

Prototype:

> :tmi.twitch.tv HOSTTARGET #hosting_channel :<channel> [<number-of-viewers>]

Channel stops host mode:

Prototype:

> :tmi.twitch.tv HOSTTARGET #hosting_channel :- [<number-of-viewers>]
Parameter Description
number-of-viewers (Optional) Number of viewers watching the host.  If provided, must be a positive integer.

NOTICE (Twitch Commands)

General notices from the server.

Prototype: 

> @msg-id=<msg id>:tmi.twitch.tv NOTICE #<channel> :<message>
Parameter Description
message The message.
msg id A message ID string. Can be used for i18ln. Valid values: see Twitch IRC: msg-id Tags.

Example:

> @msg-id=slow_off :tmi.twitch.tv NOTICE #dallas :This room is no longer in slow mode.

RECONNECT (Twitch Commands)

Rejoin channels after a restart.

Occasionally, Twitch IRC processes need to be restarted. When this happens, clients that have requested  the IRC v3 twitch.tv/commands capability are issued a RECONNECT. After a short time, the connection is closed. In this case, reconnect and rejoin channels that were on the connection, as you would normally.

ROOMSTATE (Twitch Commands)

Used when a user joins a channel or a room setting.

Prototype:

> :tmi.twitch.tv ROOMSTATE #<channel>

Use with the tags capability; see ROOMSTATE (Twitch Tags), which has additional parameters.

USERNOTICE (Twitch Commands)

Announces Twitch-specific events to the channel (e.g., a user’s subscription notification).

Use with the tags capability; see USERNOTICE (Twitch Tags), which has additional parameters.

Prototype:

> :tmi.twitch.tv USERNOTICE #<channel> :message

USERSTATE (Twitch Commands)

Identifies a user’s chat settings or properties (e.g., chat color).

Use with the tags capability; see USERSTATE (Twitch Tags), which has additional parameters.

Prototype:

> :tmi.twitch.tv USERSTATE #<channel>