DiSky DiSky v5.0.0-b1

Effects

effect

Global, non-entity effects, usable anywhere in your scripts.

18 syntaxes
18 / 18
effectasync since 5.0.0-a1
Feeling lost? This is covered in the guide Managing messages
destroy [the] %message/role/channel/emote/webhook/scheduledevent/guildsticker/automodrule%

Deletes a Discord entity: a message, a role, any channel, a custom emoji, a webhook, a scheduled event, a guild sticker or an automod rule.

To delete several messages at once, use the purge effect instead.

Helpful?
effectasync since 5.0.0-a1
Feeling lost? This is covered in the guide Sending messages
(post|dispatch) %string/embedbuilder/component/pollbuilder% (in|to) [the] [channel] %messagechannel%

Posts a text, an embed, a component or a poll in a message channel.

The sent message is discarded; build a message and read 'the result of' it to keep it.

mentioned inCreating polls
Helpful?
effectasync since 5.0.0-a1
[discord] ban [the] [user] [with] [id] %string% (from|of) [the] [guild] %guild% [and (delete|remove) %-timespan% [worth ]of message[s]] [(due to|because of|with [the] reason) %-string%]

Bans a user ID from a guild without retrieving the member first.

Works on users who already left the guild.

Helpful?
effectasync since 5.0.0-a2
Feeling lost? This is covered in the guide Posting through a webhook
[discord] delete [the] webhook message %string/message% of [the] [webhook] [client] %webhookclient% [in [the] thread %-threadchannel%]

Deletes a message that was sent through a webhook, by its message or its id.

A webhook can only delete its own messages. Name the thread when the message lives in one.

Helpful?
effectasync since 5.0.0-a2
Feeling lost? This is covered in the guide Posting through a webhook
edit [the] webhook message %string/message% of [the] [webhook] [client] %webhookclient% (with|to show) %string/embedbuilder/component/messageaction% [in [the] thread %-threadchannel%]

Edits a message that was sent through a webhook, by its message or its id.

A webhook can only edit its own messages. Name the thread when the message lives in one.

Helpful?
effectsince 5.0.0-a1
Feeling lost? This is covered in the guide Cache and await Feeling lost? This is covered in the guide Components
await <.+>

Runs an effect on a background thread and waits for it to fully complete before continuing.

On a DiSky REST property change this blocks until Discord confirms the change (instead of fire-and-forget); on a dual cache/online property read it uses the online value.

Redundant on effects that are already async.

mentioned inLinking
Helpful?
effectsince 5.0.0-a1
Feeling lost? This is covered in the guide Sending messages
reply with [:hidden] %string/embedbuilder/messageaction/component/pollbuilder% [with [the] reference[d] [message] %-message%]

Replies to the current event: in a message event the reply is posted in the event's channel, in an interaction event (slash command, button, ...) it answers the interaction.

'hidden' makes an interaction reply ephemeral (only the user who triggered it sees it); it is ignored outside interactions.

'with reference' links the reply to a message, like Discord's own reply feature.

A message builder can be replied with too: its content, embeds, attachments and poll are sent, its own channel is ignored. A component (a container, a row, a button...) is sent on its own.

Helpful?
effectsince 5.0.0-a1
show [the] [modal] %modal% [to [the] event-user]

Opens a modal for the user who triggered the current interaction: a button click, a dropdown click or a slash command. It is the interaction's answer, so nothing else may have replied or deferred it before, and a modal cannot answer another modal.

What the user submits comes back in 'on modal received'.

Helpful?
effectsince 5.0.0-a1
(defer|acknowledge) [the] interaction [:hidden] [edit:and (edit|update)]

Acknowledges the current interaction without answering it yet, which buys up to 15 minutes to reply instead of the 3 seconds Discord gives by default. A later 'reply with' goes through the deferred answer.

'hidden' makes the eventual reply ephemeral. 'and edit' (on a button or dropdown click) acknowledges without any 'thinking...' state, for when the script will only edit the message.

Helpful?
effectsince 5.0.0-a1
edit [the] interaction components (with|to [show]) [the] [components] %-components%

Replaces every component of the message whose button or dropdown was just clicked, as the answer to that interaction (or through it, if it was deferred 'and edit').

Bare buttons are grouped into rows like on a message builder. Pass nothing to strip the components.

Helpful?
effectsince 5.0.0-a1
replace [the] component with [the] [:unique] id %string/number% (of|in|from) [the] [message] %message% (with|by) %component%

Swaps one component of a sent message, found by its text id (a button, a dropdown) or its unique id (any component, including text displays and sections inside a container), for a new one. Every other component is kept as it is.

Inside a button or dropdown click on that same message, the edit is the interaction's answer.

Helpful?
effectsince 5.0.0-a2
Feeling lost? This is covered in the guide Registering commands
update [the] [discord] [application] command[s] [to] %applicationcommands% (globally (in|for|of|on) [the] [bot] %-bot%|in [the] [guild] %-guild%)

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.

Helpful?
effectsince 5.0.0-a2
Feeling lost? This is covered in the guide Registering commands
register [the] [discord] [application] command[s] %applicationcommands% (globally (in|for|of|on) [the] [bot] %-bot%|in [the] [guild] %-guild%)

Adds or replaces (by name) one or more application commands of a bot (globally) or of a guild, leaving the other registered commands alone. Use 'update the discord commands' to replace the whole list.

Once done, 'command id of' each command is known.

Helpful?
effectsince 5.0.0-a2
Feeling lost? This is covered in the guide Registering commands
unregister [the] [discord] [application] command[s] %strings/applicationcommands% (globally (from|of|in) [the] [bot] %-bot%|(from|of|in) [the] [guild] %-guild%)
unregister all [the] [discord] [application] commands (globally (from|of|in) [the] [bot] %-bot%|(from|of|in) [the] [guild] %-guild%)

Removes application commands from a bot (globally) or from a guild: by command object, by name, by id, or all of them.

A command object whose id is known is deleted directly; otherwise the registered commands are looked up and every one with that name (and type, for a command object) is removed.

Helpful?
effectsince 5.0.0-a2
Feeling lost? This is covered in the guide Command settings
localize [the] (name|:description) of %applicationcommand/slashoption/subcommand/subcommandgroup/slashchoice% (in|for) [the] [locale] %string% (as|to) %string%

Sets the name or the description shown to users of a given Discord locale, for an application command, a slash option, a subcommand, a subcommand group or a choice (choices only have a name).

Locales are Discord's codes ("fr", "de", "en-GB", "pt-BR", ...) or language names ("french").

Helpful?
effectsince 5.0.0-a2
Feeling lost? This is covered in the guide Slash options
return [the] [slash] (choices|completions) %slashchoices/strings/numbers%

Answers an autocomplete request with up to 25 suggestions and stops the trigger. Give choices, or plain texts / numbers (used as both the label and the value).

Only in 'on slash completion' and in an 'on completion request:' section of a slash command structure.

Helpful?
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.