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}
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.
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. 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}
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.
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 handler stateless 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. | |
handler | string? | The name of the component callback handler to use for the button. | |
stateless | boolean | false | Whether the custom id should be forced to stateless |
state | string? | The state to pass to the callback. | |
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 handler stateless 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 | |
handler | string | The name of the component callback handler to use for the select menu | |
stateless | boolean | false | Whether the custom id should be forced to stateless. |
state | string? | The state to pass to the callback. | |
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
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.
Name | Type | Default | Description |
---|---|---|---|
message | Message | The 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.
Name | Type | Default | Description |
---|---|---|---|
title | string | The title of the modal. | |
handler | string | The name of the component callback handler to use for the modal. | |
stateless | boolean | false | Whether the custom id should be forced |
components | ActionRowComponent[] | The components to add to the modal. | |
state | string? | 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}