Coming from DiSky 4
guidePort working DiSky 4 scripts to DiSky 5: what changed, in which order to fix it, and what no longer exists.
This section is for you if you have DiSky 4 scripts that work today and want them running on DiSky 5. It lists what changed, gives you an order to fix a script in, and says plainly what was dropped. You're assumed to know the basics of DiSky 5 (see Starting a bot and Concepts).
What changed overall
Most breakage comes from six shifts. Each one has a detailed page linked in the next section.
- Online reads use
await. DiSky 4 had a family ofretrieve ... and store it in {_x}effects. In DiSky 5 the same data is an ordinary expression, and you ask for the online version by puttingawaitin front of the line. See Cache and await. - Creation goes through builders. The
create ... and store it ineffects and the creation sections are gone. You build anew ... builder, set its properties one line each, then readthe build result ofit. See Builders. - A
discordprefix where Skript owns the word. Skript registers its syntaxes before any addon, so a DiSky syntax with the same shape would silently lose on an untyped variable. Those properties now carry a mandatorydiscord:discord content,discord author,discord colors,discord location,discord owner,discord attachments,discord permissions. - Commands are registered to Discord explicitly. Slash and context command structures are models only; nothing reaches Discord until an effect pushes them.
- Events expose values differently. Most change events give their old and new values as
past event-X/event-X,event-authoris gone, and a few events were renamed or removed. - No config file. See the last section.
# DiSky 4 retrieve member with id "123" from event-guild and store it in {_m} # DiSky 5 await set {_m} to member with id "123" in event-guild
The define bot structure still loads, but the imperative API (a new discord bot, then login) is the reference and the one this documentation uses.
Porting a script
Work in this order; each step removes a whole class of errors and makes the next one readable.
- Load the script on a DiSky 5 server and let Skript print every parse error.
- Read the errors from top to bottom. One mistake often causes several lines of noise below it, so fix the first one and reload before chasing the rest.
- Fix reading and creating first: every
retrieve ... and store it inandcreate ... and store it inline. See Retrieving and creating. - Fix the syntaxes that were renamed or gained a mandatory word. See Renamed syntaxes.
- Port commands, buttons, dropdowns and modals. See Commands and components.
- Port event handlers last, once everything inside them parses. See Events.
- Run the script against a test guild. Parsing is not proof: check that each syntax does what it did before.
What DiSky 5 does not have
Some DiSky 4 features were removed or replaced rather than renamed. Anything not in this table either exists under a new name (see the pages above) or was never in DiSky 4.
DiSky 4 feature | Status | What to do instead |
|---|---|---|
| Not available | Loop over |
| Not available | Use the |
| Not available | Keep a flag in a variable and check it in a normal event handler |
| Replaced | A message builder; |
Embed sections and | Replaced | Embed builders; there are no templates, use a function that returns a builder |
Embed from and to JSON | Not available | Set the embed's properties one by one |
| Replaced | Build the message with a message builder and read |
| Not available |
|
Sending a sticker with | Not available | None; |
| Not available | None; the guild cannot be deleted from a script |
| Replaced |
|
Named registry of webhook clients | Replaced | Store the client in a variable |
| Dropped | Read the value with |
| Dropped | See below; third-party modules must be Skript addons that depend on DiSky |
Advanced voice and audio | Not available | Only |
Renaming and editing live channels, guilds, emotes and scheduled events, slowmode, channel position, thread archived and locked, channel of %message%, the channel with id family, and the activities (watching, listening to, streaming ... with the url, competing in, custom status) all exist. A text discord command !ping with no prefixes: entry still answers to !ping. Logging in under a name already in use now shuts the previous bot down instead of leaking it.
No config file
DiSky 5 reads no configuration file and writes only plugins/DiSky/disky-syntax.json, a description of the installed syntaxes that the Atlas reads. The DiSky 4 options map to scripts: silencing an error code becomes on disky exception: with cancel event, and handling an expected failure is a try / catch block. See Errors.
on disky exception: if error code of event-discorderror is 50006: cancel event