A new, unconnected Discord bot to configure and then log in.
Expressions
expressionGlobal, non-entity expressions, usable anywhere in your scripts.
The value (-1) that tells DiSky to use Discord's recommended shard count.
The most recent Discord error that occurred (anywhere), as a discorderror. None if no error has occurred yet.
All loaded bots, or the bot(s) with a given name (as defined by a `define bot` structure).
A new, empty Discord embed to configure via the embed properties.
A new embed field with a name and a value, optionally inline, to add to an embed.
A file to send to Discord, from a local file path, a URL, or an attachment of a received message (an image too, when SkImage2 is installed).
The name defaults to the file's own; 'with spoiler' hides it behind a spoiler.
Nothing is read or downloaded until the message carrying it is sent.
What the user submitted in a modal, by the id of the component.
A text input gives its text; a dropdown, a radio group or a checkbox group give the selected values; a checkbox gives true or false; an entity dropdown gives the picked users, roles or channels ('selected entities of'); a file upload input gives the uploaded attachments ('uploaded files of').
An argument of the current 'discord command', by index ('arg-1', 'the 2nd argument'), by type
('user argument', 'text argument-2'), the last one, or all of them. Only inside the trigger of a
discord command; a named argument ('<who: user>') is also available as '{_who}'.
Every 'discord command' currently loaded, from every script.
The commands declared by 'slash command' / 'user command' / 'message command' structures, as command objects ready to be pushed: every 'slash command mod ...' structure is merged into one '/mod' command.
By name (the root word of a slash command, the full name of a context command), or all of them.
The application commands currently registered on Discord: globally for a bot, or for one guild. They come back as regular command objects (with their 'command id'), so they can be edited and pushed again.
This asks Discord, so it needs 'await'.
The users who voted for one answer of a poll. The answer is a poll answer object or its number (answers are numbered from 1 in the order they were declared); the message is the one carrying the poll, not the poll itself. Every page of voters is fetched.
This asks Discord, so it needs 'await'.
Fetches messages from the history of a channel. 'last X messages of a channel' returns the most recent ones, newest first. 'X messages before a message' returns the ones sent before it, closest (newest) first; 'X messages after a message' the ones sent after it, closest (oldest) first. The reference message itself is never included.
Any amount works: above 100, the history is fetched page by page (one request per 100 messages). Fewer messages come back when the channel does not have that many. The amount must be at least 1.
The bot needs the View Channel and Read Message History permissions. This asks Discord, so it needs 'await'.
The effective permissions of a member or a role in one channel: its guild-wide permissions, with the channel's overrides applied (@everyone first, then the roles, then the member's own override). An administrator, and the guild owner, have every permission everywhere.
In a thread, the overrides of the parent channel apply.
Read-only; change the allowed or denied discord permissions of the channel instead.
The permissions a channel explicitly allows or denies to one member or role (its permission override). Empty when the channel has no override for it; anything neither allowed nor denied is inherited from the guild-wide permissions.
Add, remove and set change the override on Discord, creating it if needed. Adding to the allowed permissions also takes them out of the denied ones (a permission cannot be both), and the other way around. Removing only clears them from the list you name: removing from the allowed permissions does not deny them, it makes them inherited again. Reset (or delete) removes the whole override, allowed and denied together.
In a thread, the override is the parent channel's: changing it changes the parent channel.
The bot needs the 'manage permissions' permission in the channel (or 'manage roles' guild-wide), and can only allow or deny permissions it has itself. Under 'await' the change waits for Discord.
An emoji from its name, its unicode character or the id of a custom one (an emote). Several texts give several emojis.
Each text is resolved in this order: a custom emoji id or its '<:name:id>' / '<a:name:id>' form, a unicode emoji ('😂'), then a name. With a guild, a name first looks for a custom emoji of that guild (case-insensitive), then for a Discord shortcode ('joy' or ':joy:', skin tones as 'thumbsup_tone2'). Without a guild, the shortcode comes first, then the custom emojis every loaded bot can see.
It reads the cache. With 'await', an id or a name missing from the cache is also looked up on Discord: in the guild when one is given, else among the bot's application emojis.
A text that matches nothing is a readable error and is skipped. Name the guild when two guilds may hold a custom emoji with the same name.
The sticker of a guild with the given name, compared case-insensitively. Returns nothing when the guild has no such sticker.
It reads the guild's sticker cache. With 'await', a name missing from the cache is looked up on Discord.
The member a user is in a guild: the same person, with the guild-side data (nickname, roles, join date...). Returns nothing when the user is not in that guild.
It reads the member cache, which depends on the bot's member cache policy. With 'await', a member missing from the cache is fetched from Discord, and a user who is not in the guild is a readable error.
The value the user gave to an option of the current slash command, by option name. Typed after what Discord sent (a text, an integer, a number, a boolean, a user, a channel, a role, a mentionable, an attachment), or after the option type you ask for; 'as member' turns a user into the guild member.
For a command declared by a 'slash command' structure, '{_name}' and 'arg-1' are simpler.
Creates a slash option from a Skript type instead of a Discord option type: a member, a colour, a text channel, a player, or any enum (its constants become the choices, or an autocomplete past 25). The same types work as '<name: type>' arguments of a 'slash command' structure.
Read the value back with 'slash option "name"' (as the Discord type) or, in a structure, as '{_name}'.