Expressions in NadekoBot
Expressions (once called custom reactions) make NadekoBot reply when someone types a trigger word or phrase in your server. The reply can be text, an embed or a random pick from several replies.
Add an expression
Say you want NadekoBot to reply "Hello there, @user" to anyone who writes "hi". Add an expression with .exa: first the trigger, then the response, as in .exa hi Hello there %user.mention%. %user.mention% is a placeholder: it becomes a mention of the member who typed the trigger.
Put a trigger of more than one word in quotes: .exa "hi there" Hello there %user.mention%. Adding expressions in a server needs the Administrator permission.
For a random reply, add several expressions with the same trigger, and NadekoBot picks one of them each time. If override mode (.exo) is on, a new expression replaces the old ones with the same trigger instead.
Reply with an embed
Like many other NadekoBot commands, expressions can reply with an embed. Build it in the embed builder, copy the JSON, then type .exa, your trigger, a space, and paste the JSON. The builder's Expression tab gives you the whole command to copy. For example, an expression with the trigger "event" can post the details of your next event.
Embeds can have avatars, images and thumbnails. Host your pictures on a site that gives you a direct link to the picture, such as catbox, and paste that link into the embed.
List, edit and delete expressions
.exl lists your server's expressions, 20 to a page: the options that are on, the ID, then the trigger. Leave out the # when you type an ID in a command: it is not part of the ID.
.exe changes an expression's response. You can't change a trigger: add a new expression and delete the old one with .exd. .exp shows an expression's response without triggering it, and .exs finds expressions by their trigger or response.
Expression options
Normally an expression triggers only when a message is the trigger and nothing else. Each expression has options that change this, and .exl shows which ones are on.
.exca (contains anywhere) makes it trigger when the trigger is anywhere in the message: an expression for "argh" then also answers "im so angry argh". .exat lets more text follow the trigger, so "hi" also answers "hi there". It turns on by itself when the response has %target%, which becomes the text after the trigger.
.exdm sends the response to the member's DMs instead of the channel, and .exad deletes the message that triggered the expression. For .exad, NadekoBot needs the Manage Messages permission.
Set it up in 3 steps
- Invite NadekoBot, then add a reply to "hi":
.exa hi Hello there %user.mention% - See your server's expressions:
.exl - Make one trigger anywhere in a message:
.exca 5c
Questions about NadekoBot expressions
Can an expression pick a random reply?
Yes - add several expressions with the same trigger, and NadekoBot picks one of them each time someone types it.
How do I make a trigger with more than one word?
Put it in quotes: .exa "hi there" Hello there %user.mention%.
Can I change an expression's trigger?
No - add a new expression with the new trigger, then delete the old one with .exd and its ID.
Why doesn't my expression answer when the word is in a sentence?
By default the message must be the trigger and nothing else. Turn on contains anywhere with .exca and the expression's ID.
How do I stop expressions from triggering on my server?
Turn off the module that runs them: .sm ActualExpressions disable.
What happened to custom reactions?
They are expressions now. The old commands still work: .acr adds one, .lcr lists them and .dcr deletes one.