Skip to main content

Events

Everything a plugin does starts with one of these. Anything not listed here is not something a plugin can see.

on message do
# event.user, event.text, ...
end

Every event carries event.channel, the display name of the chat it happened in.

message​

Someone said something in a chat you have open. The busiest event by far - a big chat can send thousands a minute, so keep the handler short.

FieldType
event.usertextlogin name, lower case
event.nametextdisplay name, as shown in chat
event.texttextthe message
event.is_modyes/nomoderator or broadcaster
event.is_subyes/nosubscriber or founder
event.is_vipyes/noVIP
event.is_firstyes/notheir first ever message in this chat
event.is_highlightyes/noit mentioned you or one of your highlight words
event.colourtexttheir name colour

Messages loaded as history when you join a chat do not fire this event.

timeout​

FieldType
event.usertextwho was timed out
event.secondsnumberhow long for
event.bytextwhich moderator, when Chattler knows
event.reasontextthe reason, when there is one
note

by and reason come from the moderation feed, which sometimes arrives a moment after the timeout itself. They can be empty even when a moderator did it. event.user and event.seconds are always there.

ban​

Same as timeout without seconds.

delete​

A single message was deleted.

FieldType
event.usertextwhose message
event.texttextwhat it said

automod​

AutoMod held a message for review. Only fires in channels you moderate.

FieldType
event.usertextwho sent it
event.texttextthe held message
event.categorytextbullying, blocked_term, blocked_link, and so on
event.levelnumberhow sure AutoMod is, 1 to 4

automod_waiting​

Fires every five seconds for each held message still waiting for an answer. This is how you nudge a mod team that has missed one.

FieldType
event.usertextwho sent it
event.texttextthe held message
event.secondsnumberhow long it has been waiting
event.categorytextas above

Use cooldown here, or you will get an alert every five seconds.

automod_result​

A moderator allowed or denied a held message.

FieldType
event.usertextwhose message
event.allowedyes/notrue allowed, false denied
event.bytextwhich moderator

modaction​

Any action from your mod team's live feed: bans, timeouts, deletions, warnings, blocked-term changes, shoutouts, chat-mode changes.

FieldType
event.actiontextban, timeout, delete, warn, raid, and so on
event.usertextwho it was aimed at, when it was aimed at someone
event.bytextwhich moderator
event.reasontextthe reason, when there is one

suspicious​

Someone Twitch flags as suspicious said something. Needs the suspicious-users permission - log in again once if you have never granted it.

FieldType
event.usertextwho
event.texttextwhat they said
event.statustextrestricted, monitored or none
event.typeslistban_evader, banned_in_shared_channel, manually_added
event.bansnumberhow many shared channels have banned them

sub​

A subscription, resub, gift or Prime upgrade.

FieldType
event.usertextwho
event.tiertext1000, 2000, 3000 or Prime
event.monthsnumbermonths in a row, when they said
event.giftedyes/nowas it a gift
event.countnumberhow many were gifted

raid​

Someone raided a chat you have open.

FieldType
event.usertextwho is raiding
event.viewersnumberhow many people came with them

redemption​

A channel point reward was redeemed.

FieldType
event.usertextwho redeemed it
event.rewardtextthe reward name
event.costnumberwhat it cost them

speed​

Fires every five seconds for every chat you have open, with how fast it is going.

FieldType
event.ratenumbermessages a minute, over the last minute

tick​

Fires every five seconds, once, with nothing to do with any particular chat. For housekeeping.

FieldType
event.timenumberthe time now

start​

Fires once when Chattler has loaded your plugins. Good for a log("loaded") while you are working on something.