Skip to main content

Overview

Create a command that replies with saved text or a saved embed, and supports every variable. Use them for anything your server repeats: the rules, the social links, a hug or a dice roll. The member types !name, and Petto answers in the channel as a reply.
chu types !hug @kira and Petto answers that chu gives kira a warm hug

In Discord: the hug command of the examples, used on another member.

Want buttons, forms, reactions or saved data? Custom commands can also be written in code. See Petto Code. Rather not write code? The Petto Code Generator builds the command with forms, lets you try it in a test channel and gives you the command to paste.

Commands

liam adds rules with its reply in quotes and Petto confirms it and points to !customcommand vars

In Discord: !rules is created.

liam adds socials with --embed_template socials and Petto confirms it

In Discord: a command that sends the saved embed socials.

liam tries to add rank and Petto answers that rank is already a real command

In Discord: rank is a command of Petto, so the name is refused.

liam edits rules with a new reply and Petto answers that it was updated

In Discord: !rules gets a new text.

liam removes say and Petto answers Removed

In Discord: !say is deleted.

Petto lists 6 of 125 custom commands: 8ball, hug, roll, rules, say and socials with their kind and size

In Discord: the commands of the server, sorted by name, with how they start and their size.

Petto shows rules and its response with {user} and {channel}

In Discord: the saved reply of !rules, with its variables as written.

Petto's info of rules: kind text, starts with the prefix of the server, size 65 characters

In Discord: what !rules is: a text command, how it starts and its size.

liam renames rules to rulebook and Petto confirms it and warns that old buttons keep the old name

In Discord: !rules is now !rulebook.

Chillet types !rules and Petto replies Hi @Chillet, the rules are pinned in general

In Discord: a member uses !rules and Petto answers as a reply.

Put the response in “quotes” when it has spaces. Without them only the first word is the response and the rest is read as the name of a saved embed.
!cc is the short name of !customcommand. A name that is already a command of Petto (like rank) is refused, and so is a name that another custom command has.

Arguments

Whatever the member types after the command can be used in the reply. Text in quotes counts as one argument, and mentions typed by members never ping anyone or cause mass mentions. !customcommand vars shows these variables and the reply flags in Discord. When the reply uses an argument and the member types nothing after the command, Petto asks for the text instead of sending an empty reply.
Petto's card Custom command variables with args, arg1 to arg10, args_from, arg_count, command_name, prefix and the reactreply flag

In Discord: !customcommand vars, the arguments, the variables and the reply flags.

Chillet types !say alone and Petto replies that this custom command needs text after it

In Discord: !say needs text after it, so Petto asks for it.

Examples

Command
Result
Saved embeds used by a custom command can use all of these too. The full list is on the Variables page. For anything with conditions (if), saved data or buttons, write the command in Petto Code instead. Put a ! before a mention in a reply (!@Role, !{user.mention}) to show it without notifying anyone: see Silent mentions.

Plain text or embed

If embed_template is set, it takes priority over response, the saved embed is sent instead of plain text. Manage embed templates on the dashboard’s Embeds page or with !embed. A custom command can use an embed template alone, with no text. Editing a command keeps the fields you leave out.
shi types !socials and Petto replies with the Our socials embed with the website, YouTube and X

In Discord: !socials sends its saved embed instead of text.

Limits

A Free server can have 125 custom commands and a Premium server 250 (commands in code count too). See Premium.

Dashboard

The same commands are in Automation → Custom commands of the dashboard: each command as a member would use it and Petto’s answer, a button to delete it, and a form to add one with its text or a saved embed. Commands written in code are edited in Commands in code.
The Custom commands section, 8 of 125, with 8ball, hug, rank, roll, rules, socials, vote and whois (the ones in code say Written in code), and the add form

Dashboard → Automation → Custom commands: every command as a member would use it and Petto's answer, and the form to add one.