Migrating to v4.26
DiSky v4.26.0 introduces new features, improvements to message editing, and several bug fixes. This guide will help you update your scripts for compatibility.
Breaking Changes
Section titled “Breaking Changes”Message Editing Behavior
Section titled “Message Editing Behavior”The edit message effect now has different default behavior:
Before v4.26
Section titled “Before v4.26”Editing a message would replace everything (content, embeds, components):
edit message {_msg} to show "New content"# ❌ This removed all embeds and componentsSince v4.26
Section titled “Since v4.26”Default behavior (recommended) - Partial update that preserves unchanged elements:
edit message {_msg} to show "New content"# ✅ Keeps existing embeds and componentsExplicit replacement - Use when you want the old behavior:
edit and replace message {_msg} to show "New content"# ✅ Removes embeds and components that aren't specified
# Alternative syntaxedit message {_msg} by replacing to show "New content"Migration Steps
Section titled “Migration Steps”-
Find all
edit messageeffects in your codeSearch for:
edit messageoredit the message -
Determine the intent
Ask: “Do I want to keep existing embeds/components?”
- Yes → No changes needed (new default behavior)
- No → Add
and replaceorby replacing
-
Update the code
# Old code (v4.25 and earlier)edit message {_msg} to show "Updated"# New code (v4.26+)# If you want to keep embeds/components:edit message {_msg} to show "Updated"# If you want to remove them:edit and replace message {_msg} to show "Updated" -
Test thoroughly
Verify that your message edits work as expected.
New Features
Section titled “New Features”1. Embed Fields as Expressions
Section titled “1. Embed Fields as Expressions”You can now get embed fields directly as a list:
# Get all fields from an embedset {_fields::*} to embed fields of {_embed}
# Loop through fieldsloop {_fields::*}: send "Field: %name of loop-value% = %value of loop-value%" to consoleUse cases:
- Inspect existing embed fields
- Copy fields from one embed to another
- Modify field data programmatically
Example:
# Copy fields from one embed to anotherset {_originalFields::*} to embed fields of {_originalEmbed}
make embed and store it in {_newEmbed}: set title of embed to "Modified Embed" set embed color of embed to blue
loop {_originalFields::*}: add loop-value to fields of {_newEmbed}
reply with {_newEmbed}2. Member Boost Time
Section titled “2. Member Boost Time”Track how long members have been boosting your server:
# Get boost date (when they started boosting)set {_boostDate} to boost date of {_member}
# Calculate boost durationset {_boostDuration} to difference between now and boost date of {_member}
# Example usageon message receive: if message is "!boostinfo": set {_boostDate} to boost date of event-member
if {_boostDate} is not set: reply with "You're not boosting this server." else: set {_duration} to difference between now and {_boostDate} reply with "You've been boosting for %{_duration}%! Thank you! 💎"Practical example - Boost Leaderboard:
command /boostleaderboard: trigger: set {_boosters::*} to boosters of event-guild
make embed and store it in {_embed}: set title of embed to "Boost Leaderboard" set embed color of embed to hex "#F47FFF" # Boost color
loop {_boosters::*}: set {_duration} to difference between now and boost date of loop-value add field named "%discord name of loop-value%" with value "Boosting for %{_duration}%" to fields of embed
reply with {_embed}3. Embed Templates
Section titled “3. Embed Templates”Reuse embeds across your bot with templates:
# Register template onceregister embed "success": set title of embed to "✅ Success" set embed color of embed to green set footer of embed to "Operation completed"
register embed "error": set title of embed to "❌ Error" set embed color of embed to red set footer of embed to "Please try again"
# Use templates anywhereon slash command: if event-string is "test": # Use template directly reply with embed template "success"
# Or modify it make embed based on embed template "error": set description of embed to "Something went wrong with your request" reply with last embedBug Fixes
Section titled “Bug Fixes”Slash Command Registration
Section titled “Slash Command Registration”Fixed several issues with slash commands:
- ✅ Commands now maintain consistent IDs across restarts
- ✅ Guild-specific commands load properly without hanging
- ✅ Command settings persist after server restarts
- ✅ Improved registration performance
What this means:
- You no longer need to wait hours for commands to update
- Commands won’t duplicate or break after server restarts
- Guild commands register instantly
Message Editing
Section titled “Message Editing”- ✅ Fixed embeds being removed when editing message content
- ✅ Fixed components disappearing during message updates
- ✅ Improved error handling for invalid edits
Upgrade Checklist
Section titled “Upgrade Checklist”-
Backup your scripts
Always backup before updating!
-
Update DiSky
-
Update message edit calls
Search for
edit messageand addand replacewhere needed -
Test slash commands
Verify all commands register and function correctly
-
Test message editing
Ensure edited messages keep or remove content as intended
-
Review new features
Consider using embed templates and boost tracking
-
Restart server
Always restart (don’t use
/reload)
Examples
Section titled “Examples”Message Editing Pattern
Section titled “Message Editing Pattern”# Updating only content (keeps embeds and buttons)edit message {_msg} to show "Updated content only"
# Updating with new embed (keeps old content)make embed: set title of embed to "New Embed" set embed color of embed to blueedit message {_msg} to show last embed
# Complete replacement (removes everything not specified)edit and replace message {_msg} to show "Only this text"
# Replace with new content and embedmake embed: set title of embed to "Fresh Start"edit and replace message {_msg} to show "New" with last embedUsing Boost Information
Section titled “Using Boost Information”# Thank boosterson guild member boost: set {_channel} to text channel named "announcements" in event-guild if {_channel} is set: make embed: set title of embed to "Thank you for boosting!" set description of embed to "%mention tag of event-member% just boosted the server! 💎" set embed color of embed to hex "#F47FFF" set thumbnail of embed to avatar of event-user
post last embed to {_channel}
# Boost duration commandcommand /myboost: trigger: set {_date} to boost date of event-member
if {_date} is not set: reply with "You're not currently boosting this server." else: set {_time} to difference between now and {_date} reply with "You've been boosting for %{_time}%! Thanks for your support! 💎"Common Issues
Section titled “Common Issues””Command already exists” Error
Section titled “”Command already exists” Error”If you get duplicate command errors after updating:
- Delete all existing commands (optional)
- Restart server
- Let DiSky re-register commands
Message Edits Remove Content
Section titled “Message Edits Remove Content”If your edited messages are losing embeds/components:
Problem:
edit message {_msg} to show "New text"# Embeds disappeared!Solution: This is now the expected behavior. To remove content, use:
edit and replace message {_msg} to show "New text"Boost Date Returns Nothing
Section titled “Boost Date Returns Nothing”The member must be actively boosting. Check with:
if event-member is boosting event-guild: # They're boosting set {_date} to boost date of event-memberelse: # Not boosting reply with "You're not boosting this server"Next Steps
Section titled “Next Steps”- Learn about Embed Templates
- Explore Message Editing
- Check out Slash Commands
Need Help?
Section titled “Need Help?”If you encounter issues during migration:
- Check the FAQ
- Search existing issues on GitHub
- Ask in our Discord server
Remember to include:
- Your DiSky version (
/ver disky) - The specific error message
- Relevant code snippet