Update Discord Commands (Effect) — DiSky

Addon: DiSky · Category: Effect · Since: 5.0.0-a2

Syntax

update [the] [discord] [application] command[s] [to] %types.applicationcommand% (globally (in|for|of|on) [the] [bot] %types.bot%|in [the] [guild] %types.guild%)

Description

Replaces every application command of a bot (globally) or of a guild with the given ones: what is not in the list is removed from Discord. This is the one call to make from 'on ready' / 'on guild ready'. Global commands take up to an hour to show up for users; guild commands are immediate. Discord limits how often a guild's command list can be replaced (200 times a day). Once done, 'command id of' each command is known.

Examples

on guild ready:
	update the discord commands (all structured application commands) in event-guild

on ready:
	set {_ping} to a new slash command named "ping" with description "Pong!"
	update the discord commands {_ping} globally in event-bot

View source