Chat commands
guideCommands matched on what a user types in a channel, declared entirely in Skript and never registered on Discord.
A chat command is matched on message text: the bot watches every message it receives and, when the text matches <prefix><name> <arguments>, runs the command's trigger. Nothing is registered on Discord. You're assumed to have a bot named "my-bot" logged in (see Starting a bot).
discord command ping: prefixes: "!" trigger: reply with "pong"
Sending !ping in any channel the bot can see runs the trigger and replies pong.
Chat or interaction commands
Need | Use |
|---|---|
Answers to typed text, no Discord registration, works on any client | a chat command, this section |
A |
Both families can live in the same script: a chat command reads its arguments from the message text, an interaction command gets them typed and validated by Discord before the bot sees them.
Reading order
- Declaring a command: the structure, prefixes, aliases, and what the trigger can read.
- Arguments: the argument grammar, types, resolution and named locals.
- Restricting a command: channels, roles, permissions, bots and cooldowns.
- Listing and events:
on discord command used, every loaded command, and a help command.