Triggers

A rule has exactly one trigger. It decides both when the rule runs and which variables you get to work with.

Message triggers

TriggerFires when
message_createsomeone posts a message
message_edita message is edited
message_deletea message is deleted

message_create and message_edit accept a match type: any_message, contains, exact, starts_with, ends_with, or regex. With contains you can also demand a whole word, so bad stops matching inside badminton. message_delete has no match type: the message is already gone, so every delete in scope fires the rule and you filter with the channel and role settings instead.

Regex patterns run on a linear-time engine (RE2). That is why some exotic patterns are refused at save time: a pattern that could hang the bot on a crafted message is rejected rather than shipped.

Discord's edit and delete events do not carry the message as it was before. FlaviBot keeps its own short-lived copy for servers that have a rule needing it, which is what makes {message.old_content} on an edit, and the whole message on a delete, work at all. Two consequences: the copy starts being kept when you save the rule, so a message posted before that has nothing to recover, and it is dropped after 48 hours.

On a delete, the deleted message's author is {message.author.mention}, not {user.mention}. Discord never says who pressed delete, so the rule has no actor and {user.*} would be a lie.

Reaction triggers

TriggerFires when
reaction_addsomeone reacts to a message
reaction_removesomeone removes their reaction

Both can be limited to specific emojis, and reaction_add exposes {reaction.count}, the total on that message, which is what a "pin it at 5 stars" or "mute at 10 flags" rule counts on.

Member triggers

member_join, member_leave, boost_start, boost_end, member_role_add, member_role_remove, member_nickname_change, member_timeout.

member_join can additionally require a minimum account age, which is what turns it into an anti-scam gate: fire only for accounts younger than N days, then kick or ban.

Interaction triggers

TriggerFires when
button_clicka member clicks a button you placed
select_menua member picks an option in a dropdown

These are how panels work. A button trigger can also open a form (a modal) on click: the rule then runs when the form is submitted, and every answer becomes a variable.

A select menu exposes what was picked as {select.value}, and can be restricted to specific option values.

Voice, channel and role triggers

voice_join, voice_leave, voice_move, channel_create, channel_update, channel_delete, thread_create, role_create, role_update, role_delete, invite_create, invite_delete.

Feature triggers

These come from FlaviBot itself rather than from Discord:

  • level_up, a member gains a level (optionally only past level N)
  • music_track_start, a track starts playing
  • ticket_open, ticket_close
  • economy_balance_threshold, economy_item_purchase
  • automod_action, Discord AutoMod acted on someone

Triggers with no event at all

  • scheduled, runs on a repeating interval, with no Discord event behind it
  • webhook, runs when an outside service calls a secret URL
  • custom_event, runs when another rule of your server emits a named event. See custom events.
flav-codeWritten on 8 August 2026