Server configuration
Custom Scripts
Save reusable scripts under a name and show them on demand from a button.
Slash commands for this page
Set this up in Discord with /configure feature:Custom scripts.
Use the slash version of each command below. Prefix commands keep working until March 5, 2027. What is changing
,embed save→/embed save,custom→/configure feature:Custom scripts,customscript→/configure feature:Custom scripts,customs→/configure feature:Custom scripts,custom add→/configure feature:Custom scripts,custom test→/configure feature:Custom scripts
,custom list→/configure feature:Custom scripts,custom raw→/configure feature:Custom scripts,custom rename→/configure feature:Custom scripts,custom remove→/configure feature:Custom scripts,custom reset→/configure feature:Custom scripts
Overview
A custom script is a named, reusable script stored in your server. On its own it does nothing: it becomes useful when you point a button at it. Anyone who clicks that button gets the script rendered as a private reply that only they can see.
That makes custom scripts the right tool for rules, FAQs, staff applications, price lists, or any long block of content you'd rather not paste into the channel over and over.
Managing custom scripts requires Manage Server. Clicking a button that shows one requires nothing: the reply is ephemeral, so it never clutters the channel.
Creating a Script
,custom add (name) (script),custom add rules {embed}$v{title: Server Rules}$v{description: Be kind. No spam. No self-promo.}Adding a script under a name that already exists overwrites it.
Naming rules
- 1–32 characters.
- Lowercase letters, digits,
-and_only. - Must start with a letter or a digit.
Names are normalized for you, so ,custom add Rules ... and ,custom test RULES both refer to rules.
A server can hold 3 custom scripts, or as many as you like with Server Premium. Once you hit the limit, delete one before adding another. Updating a script that already exists never counts against the limit.
Attaching a Script to a Button
Reference the script by name inside any button in a Components V2 message:
{cv2}{text: Read before posting}{button: label: Server Rules && custom: rules && style: primary}custom:, custom_id: and id: are interchangeable. See Components V2 for the full button syntax.
When a member clicks the button:
- greed looks the script up in the server it was clicked in.
- It renders the script against the clicker:
{user.*}refers to them,{guild.*}and{channel.*}to where they clicked. - The result is sent as an ephemeral reply, and the script's use counter goes up by one.
A button pointing at a name that doesn't exist, or at an invalid name, renders as a greyed-out, non-clickable button. Create the script before you send the message that references it. If the script is deleted later, the button stays clickable but replies with a "that script no longer exists" notice.
Managing Scripts
| Command | What it does |
|---|---|
,custom list | Paginated list of every script with its use count and a preview. |
,custom test (name) | Renders the script right now so you can see it before publishing. |
,custom raw (name) | Prints the script's source text, or sends it as a .txt file if it's too long. |
,custom rename (name) (newname) | Renames a script. Buttons pointing at the old name break. |
,custom remove (name) | Deletes a single script. |
,custom reset | Deletes every custom script in the server, after a confirmation. |
,custom also answers to ,customscript and ,customs, and ,custom add to ,custom create.
Use ,custom test before you attach a script to anything. A script that renders nothing: no text, no embed, no components: is rejected on click, so it's worth catching early.
Example: A Rules Button
Save the script
,custom add rules {embed}$v{title: {guild.name} Rules}$v{description: 1. Be respectful.\n2. No advertising.\n3. Keep it in the right channel.}$v{color: #5d86cf}Preview it
,custom test rulesPost the message with the button
Run this in the channel the message should live in:
,embed create {cv2}{text: ## Welcome to {guild.name}}{text: Everything you need is one click away.}{button: label: Read the rules && custom: rules && style: primary}
The rules message now lives behind a single button, and ,custom list tells you how many people have actually read it.
Using the dashboard assistant
Ask the assistant in the dashboard something like "make a rules script with our five rules" and it shows you the script to approve before it is saved. It can save, update, rename and remove custom scripts and list the ones your server has. You need Manage Server.
You can tell the assistant to use one of your saved embeds, for example "save my rules embed as a custom script called rules". It can see the names of the embeds you saved with ,embed save, and uses the version you have saved at the moment you approve. You can also paste a Discord message JSON and it is turned into a script.