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.
Name | Type |
---|---|
message | string |
{responder.dm fallback;member}
createDirectMessage
Set the responder to dm a user. This tag can be hit and miss if the user has their direct-messages closed.
Name | Type | Default | Description |
---|---|---|---|
fallback | boolean | false | Whether to fall back to the invocation channel if the user has DMs disabled. |
member | User? | 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.
Name | Type | Description |
---|---|---|
json | string? | Raw embed JSON |
title | string? | Sets the embed title |
description | string? | Sets the embed description |
url | string? | Sets the embed title url |
authorName | string? | Sets the author name |
authorUrl | string? | Sets the author url |
authorImage | string? | Sets the author icon url |
thumbnail | string? | Sets the embed thumbnail |
image | string? | Sets the embed image |
color | Colour? | Sets the embed pill color |
footer | string? | Sets the embed footer text |
footerIcon | string? | Sets the embed footer icon url |
timestamp | Time? | 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.
Name | Type | Default |
---|---|---|
name | string | |
value | string | |
inline | boolean | false |
{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.
Name | Type | Default |
---|---|---|
channel | Channel | context 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, so that it is only viewable by the user who created the interaction. Only works with interactions.
Name | Type | Default |
---|---|---|
ephemeral | boolean | true |
{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.
Name | Type |
---|---|
message | string? |
{responder.send return_id ignore_interaction}
createMessage
Send the message immediately. This will automatically call {responder.reset}
if the message is sent successfully.
Name | Type | Default | Description |
---|---|---|---|
returnId | boolean | false | Whether to return the sent messages ID. does not work when replying to an interaction. |
ignoreInteraction | boolean | false | Whether to ignore the context interaction when creating the message. The interaction still needs a reply or it will be marked as failed. |
silent | boolean | false | Whether 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.
Name | Type |
---|---|
message | Message |
{responder.button label callback_name stateless callback_state url emoji style actionRowIndex disabled userLock}
Adds a Button component to the message.
Name | Type | Default | Description |
---|---|---|---|
label | string | The text of the button. | |
callback_name | string? | The name of the Component Callback action to run when this button is pressed. | |
stateless | boolean | false | Whether the custom id should be forced to stateless |
callback_state | string? | Data to give to the Component Callback action, available as {$state} . | |
url | string? | The link to open when the button is clicked. | |
emoji | Emoji? | The emoji to use for the button. Can be a guild emoji or a native emoji. | |
style | ButtonStyle | Primary | The style of the button to add. This will be ignored if url is present. |
disabled | boolean | false | Whether this button is disabled. |
actionRowIndex | number? | The action row index to add this button to. | |
userLock | User? | 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 callback_name stateless callback_state disabled placeholder minValues maxValues actionRowIndex type userLock;options}
Adds a Select menu component to the message with the given options.
Name | Type | Default | Description |
---|---|---|---|
options | SelectOption[] | Options to add to the select menu | |
callback_name | string | The name of the Component Callback action to run when this button is pressed. | |
stateless | boolean | false | Whether the custom id should be forced to stateless. |
callback_state | string? | Data to give to the Component Callback action, available as {$state} . | |
disabled | boolean | false | Whether this select menu is disabled. |
placeholder | string? | The text to show when no menu item is selected. | |
minValues | number? | The minimum number of values that can be selected. | |
maxValues | number? | The maximum number of values that can be selected. | |
type | SelectType | StringSelect | The type of select menu to create. |
actionRowIndex | number? | The action row index to add this select menu to. | |
userLock | User? | The user to lock interaction to. |
{responder.select
callback_name=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.
Name | Type | Default | Description |
---|---|---|---|
message | Message | The message to reply to. |
{responder.sendModal;title;callback_name;stateless;components;callback_state}
Reply to an interaction with a modal that pops up on the context users screen.
Name | Type | Default | Description |
---|---|---|---|
title | string | The title of the modal. | |
callback_name | string | The name of the Component Callback action to run when this button is pressed. | |
stateless | boolean | false | Whether the custom id should be forced |
components | ActionRowComponent[] | The components to add to the modal. | |
callback_state | string? | Data to give to the Component Callback action, available as {$state} . |
{=data;{{
"components": [
{
"type": 1,
"components": [
{
"type": 4,
"custom_id": "my_input",
"style": "short",
"label": "Your Name",
"required": true
}
]
}
]
}}}
{responder.sendModal
title="Example Modal"
callback_name="my_modal_callback"
components={$data.components}
}
This script will create a modal with the title "Example Modal" and a single input field labelled "Your Name".
The Component Callback action "my_modal_callback" will be run 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" callback_name="my_callback"}
{responder.clearComponents}
{responder.send}
{responder.deferReply;ephemeral}
Normally, actions time out after 3 seconds of not having a reply. If your action is slow, it can be important to defer your reply so you have more time. This tag will tell Discord to wait a bit longer, showing a loading state to the user while they wait. This can only be used with an interaction in context.
Name | Type | Default | Description |
---|---|---|---|
ephemeral | boolean | false | Whether to mark the deferred reply as ephemeral, only visible to the user who triggered the interaction. |
// Defer the reply first to show a loading state
{responder.deferReply}
// Do some time-consuming operations...
{sleep;2}
// Then send your actual response
{responder.text;Here's your response after processing!}
{responder.send}
You must still send a response after deferring or the interaction will be marked as failed.