Server Configuration

Custom Scripts

Save reusable scripts under a name and show them on demand from a button.

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)

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 100 custom scripts. Once you hit the limit, delete one before adding another.


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:

  1. greed looks the script up in the server it was clicked in.
  2. It renders the script against the clicker — {user.*} refers to them, {guild.*} and {channel.*} to where they clicked.
  3. 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

CommandWhat it does
,custom listPaginated 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 resetDeletes 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 rules

Post 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.