Slash Command Structure (Structure) — DiSky
Addon: DiSky · Category: Structure · Since: 5.0.0-a2
Syntax
slash command <([\p{L}\p{N}_'-]+( [\p{L}\p{N}_'-]+){0,2})( .+)?$>Description
Declares a slash command: its path (up to three words: command, group, subcommand), its arguments as '<name: type>' (wrapped in [ ] when optional), and a trigger that runs when it is used. Every argument is available as '{_name}' and as 'arg-1' / 'user argument' in the trigger. Entries: description (a text, or a section of 'locale: text' lines with en-US), name (a section of translated names), enabled for (permissions), disabled, nsfw, contexts, integration types, cooldown + cooldown scope + on cooldown, arguments (per argument: a description, or a section with description, choices and 'on completion request'), trigger. Declaring 'slash command mod ban' and 'slash command mod kick' gives one '/mod' command with two subcommands; a 'slash command mod:' without trigger describes the root. Nothing is sent to Discord: register the result from 'on ready' / 'on guild ready' with 'update the discord commands (all structured application commands) in ...'.
Examples
slash command mod ban <target: member> [<reason: string>]:
description: Ban a member
enabled for: ban members
arguments:
target: Who to ban
reason: Why
trigger:
defer the interaction
ban {_target} with reason {_reason}
reply with "Banned %{_target}%"
on guild ready:
update the discord commands (all structured application commands) in event-guild