Tags

Sending Messages with {responder}

{responder} tags let you construct a message that will be sent once the action is over, or you manually send it. These tags are meant to be chained together to form a complete responder.

{responder.text;Hello!}
{responder.embed title="World"}
{responder.send}

{responder.text;message}

Appends text to the output message. If there is more text, it will be appended to the existing text.

{responder.text;Hello World} will make the output message "Hello World" {responder.text;Hello}{responder.text;World} will make the output message "Hello World" {responder.text;Hello}{responder.text;} empty text will clear existing text.

NameType
messagestring

{responder.dm fallback;member}

Note

This tag is part of the Create DM expensive group.

Set the responder to dm a user. This tag can be hit and miss if the user has their direct-messages closed.

NameTypeDefaultDescription
fallbackbooleanfalseWhether to fall back to the invocation channel if the user has DMs disabled.
memberUser?The user to direct-message. Defaults to the user who invoked the command.

{responder.embed}

This tag is used to add embeds to the message. Calling it multiple times will add multiple embeds to the message, up to a maximum of 10.

NameTypeDescription
jsonstring?Raw embed JSON
titlestring?Sets the embed title
descriptionstring?Sets the embed description
urlstring?Sets the embed title url
authorNamestring?Sets the author name
authorUrlstring?Sets the author url
authorImagestring?Sets the author icon url
thumbnailstring?Sets the embed thumbnail
imagestring?Sets the embed image
colorColour?Sets the embed pill color
footerstring?Sets the embed footer text
footerIconstring?Sets the embed footer icon url
timestampTime?Sets the embed timestamp

Use the Embed Builder to quickly build an embed.

{responder.embedField;name;value;inline}

Add a field to the last created embed.

NameTypeDefault
namestring
valuestring
inlinebooleanfalse
{responder.embed title="My Embed" description="Fortnite or something idk"}
{responder.embedField name="My Field" value="very cool" inline=true}
{responder.embedField name="Another One" value="even cooler" inline=true}

{responder.channel;channel}

Set the channel the message will be sent to. Setting a channel with a context interaction will have the responder ignore that interaction when sending a message. The context interaction must still be replied to or it will be marked as failed.

NameTypeDefault
channelChannelcontext Channel
// Do some weird logging stuff to a separate channel that the user will never see
{responder.channel;MY_LOG_CHANNEL}
{responder.text;{user.mention} ran our command!}
{responder.send} // Send the log message to the log channel

// Now we reply to the slash command (context interaction). This is required,
// not replying will have Discord mark the interaction as failed. Depending on a few factors,
// if we don't reply Atlas will automatically send a "The action did not output anything" message
// to stop it being marked as failed.
{responder.text;Hi {user.mention}! This is a reply to the context interaction that is required for it not to fail}
// No need for {responder.send} as it is automatically once the script finishes executing if its configured

{responder.reset}

Reset any options already applied to the responder. This tag has no arguments.

{responder.text;Hello}
{responder.reset}
{responder.text;Something bad happened!}

This would output "Something bad happened!"

{responder.ephemeral}

Mark the message as ephemeral. Only works with interactions.

NameTypeDefault
ephemeralbooleantrue

{responder.error;message}

This is the same as {responder.text}, with some extras;

  • Embeds will be set to red
  • The message will be set to ephemeral

You should use this whenever sending error messages.

NameType
messagestring?

{responder.send return_id ignore_interaction}

Note

This tag is part of the Create Message expensive group.

Send the message immediately. This will automatically call {responder.reset} if the message is sent successfully.

NameTypeDefaultDescription
returnIdbooleanfalseWhether to return the sent messages ID. does not work when replying to an interaction.
ignoreInteractionbooleanfalseWhether to ignore the context interaction when creating the message. The interaction still needs a reply or it will be marked as failed.
silentbooleanfalseWhether to suppress notifications and send the message silently.

return_id can be used to get the output message ID. return_id does not work when replying to an interaction. Discord does not give us message data when we send an interaction, however because the responder will assume you mean the context interaction, leaving out the ID should do effectively the same thing.

ignore_interaction can be set to have the responder ignore the context interaction and reply with a regular message in the context channel. The interaction still needs a reply or it will be marked as failed, you should only use this to send off a separate message.

If the responder is configured when the script finishes, it will be sent automatically. This means you probably don't need {responder.send} unless you're sending multiple messages.

{responder.edit;message}

Set the responder to edit the given message. Atlas must have sent the message to edit it. Place after the new message content.

NameType
messageMessage

{responder.button label handler stateless state url emoji style actionRowIndex disabled userLock}

Adds a Button component to the message.

NameTypeDefaultDescription
labelstringThe text of the button.
handlerstring?The name of the component callback handler to use for the button.
statelessbooleanfalseWhether the custom id should be forced to stateless
statestring?The state to pass to the callback.
urlstring?The link to open when the button is clicked.
emojiEmoji?The emoji to use for the button. Can be a guild emoji or a native emoji.
styleButtonStylePrimaryThe style of the button to add. This will be ignored if url is present.
disabledbooleanfalseWhether this button is disabled.
actionRowIndexnumber?The action row index to add this button to.
userLockUser?The user to lock interaction to.

If you want a button to only have an emoji, here is a fun hack. Copy this empty space and paste it into the button label.

{responder.select handler stateless state disabled placeholder minValues maxValues actionRowIndex type userLock;options}

Adds a Select menu component to the message with the given options.

NameTypeDefaultDescription
optionsSelectOption[]Options to add to the select menu
handlerstringThe name of the component callback handler to use for the select menu
statelessbooleanfalseWhether the custom id should be forced to stateless.
statestring?The state to pass to the callback.
disabledbooleanfalseWhether this select menu is disabled.
placeholderstring?The text to show when no menu item is selected.
minValuesnumber?The minimum number of values that can be selected.
maxValuesnumber?The maximum number of values that can be selected.
typeSelectTypeStringSelectThe type of select menu to create.
actionRowIndexnumber?The action row index to add this select menu to.
userLockUser?The user to lock interaction to.
{responder.select
handler=my_callback
placeholder="Select an option"
options={{[
{
"label": "Option One",
"value": "1"
},
{
"label": "Option Two",
"value": "2"
}
]}}
}

{responder.reference;message}

Set the responder to reference the given message. Call with no params, {responder.reference}, to stop the bot replying to the context message.

NameTypeDefaultDescription
messageMessageThe message to reply to.

{responder.sendModal;title;handler;stateless;components;state}

Reply to an interaction with a modal that pops up on the context users screen.

NameTypeDefaultDescription
titlestringThe title of the modal.
handlerstringThe name of the component callback handler to use for the modal.
statelessbooleanfalseWhether the custom id should be forced
componentsActionRowComponent[]The components to add to the modal.
statestring?The state to pass to the callback.
{=data;{{
"components": [
{
"type": 1,
"components": [
{
"type": 4,
"custom_id": "my_input",
"style": "short",
"label": "Your Name",
"required": true
}
]
}
]
}}}

{responder.sendModal
title="Example Modal"
handler="my_modal_handler"
components={$data.components}
}

This script will create a modal with the title "Example Modal" and a single input field labelled "Your Name". The handler action "my_modal_handler" will be called when the user submits the modal. The values will be available in the callback action as {$fields}.

{responder.clearComponents}

Clears all buttons, select menus, etc from the message. This tag has no arguments.

// This would clear all existing components from a message.
// Useful in a button callback
{responder.clearComponents}
{responder.send}
// This would send an empty message, because we're creating a button then removing it.
{responder.button label="Click me" handler="my_handler"}
{responder.clearComponents}
{responder.send}