Scripting
Button Code
Write a button straight into a message.
#Structure
There are two ways to write one.
{button: β¦}is a quick button: a link, or a button that's only there to look at. Its pieces are split by&&.{button}$v{β¦}is button code: a whole button with its own reply. As in embed code,{opens a setting,:goes between its name and value,$vgoes between settings and}closes one.
{button: https://utilities.best && Website}
{button}$v{label: Rules}$v{style: blurple}$v{response: Read #rules.}#Parameters
Only {button} is needed; the rest are optional.
{label: text}the text on the button.{style: blurple}its color:blurple,green,greyorred. Grey if left out.{emoji: π}an emoji on it.{response: text}the reply when pressed. Can hold variables, embeds and more buttons.{limitation: limited}limitedstops it after one press;strictstops every button on the message.{ephemeral: true}only whoever pressed it sees the reply.{author_only: true}only the person the message is for can press it.{url: link}makes a saved button a link. Ignored in a message.
In a message, the reply is stored in the button, so it must be short: about 50 characters, fewer with ephemeral, limitation or author_only. A button that doesn't fit is left out; for more, reply with a saved embed, {response: {embed:rules}}, or use /button create.
#Quick buttons
The pieces of {button: β¦} go in order, or by name.
Link
- Link: starting with
https://orhttp://. - Label: the text on it.
- disabled (optional): can't be pressed.
{button: https://utilities.best && Website}Colored button
- Color:
blurple(orblue),green,grey(orgray) orred. - Label: the text on it.
- Emoji (optional).
- disabled (optional): greyed out.
Pressing it does nothing. For one that replies, use button code or a saved button.
{button: green && Open && β
}
{button: red && Sold out && disabled}Named pieces
label:,style:,url:andemoji:, in any order.disabled(optional).
The only way to make an emoji-only button, or a link with an emoji.
{button: emoji: π && style: blurple}
{button: url: https://utilities.best && label: Website && emoji: π}#Variables
A reply's variables are filled in for whoever pressed the button. A quick button's label takes them too.
{button}$v{label: Me}$v{response: You are {user.mention}.}#Where it works
Every message you write for the bot, and inside embed code: welcome, leave and boost messages, autoresponders, sticky messages, button replies and /send. Up to 25 buttons per message. The button editor's Button code box takes it too, {url} included.
#Frequently asked questions
#Why doesn't my button show up?
Button code that can't be used is left out. Check for:
- A reply too long to fit (see above).
- A style other than
blurple,green,greyorred.primaryandblueonly work in quick buttons. {ephemeral: false}or{author_only: false}. Leave them out instead.{author_only: true}in a sticky message or/send, where the message isn't for anyone.
#Why is my quick button sent as text?
A piece didn't read: an unknown color, a link not starting with http, or an emoji after a link's label. Use named pieces to give a link an emoji.
#Who is the person a message is for?
The member in a welcome, leave or boost message, whoever set off an autoresponder, and whoever pressed the button a reply came from. Only they can press an author_only button.
#How do I get the code of a saved button?
Give a saved button's name, or a link to a message in your server for the saved buttons on it.
,button code (name)
,button code rules