Migrating to v4.27
DiSky v4.27.0 introduces new features and improvements for thread management, server tags, and slash command structures. This migration guide will help you update your DiSky scripts to be compatible with the new version.
New Features
Section titled “New Features”Thread Owner and Message Count
Section titled “Thread Owner and Message Count”You can now retrieve the owner of a thread channel and get the total message count of a thread. These expressions work with thread channels, including forum posts.
# Get the owner of a threadset {_owner} to owner of {_thread}set {_owner} to thread owner of {_threadChannel}
# Get the message count of a threadset {_count} to message count of {_thread}set {_msgCount} to thread message count of {_threadChannel}Use Cases:
- Check who created a forum post
- Display thread statistics in embeds
- Moderate threads based on their creator
- Track activity in forum channels
Example - Forum Post Information:
on thread create: set {_owner} to owner of event-threadchannel set {_count} to message count of event-threadchannel
send "New post created by %discord name of {_owner}% with %{_count}% message(s)" to channel with id "logs-channel-id"Example - Thread Statistics Embed:
command /threadstats: trigger: # Verify we're in a thread if event-channel is not a thread channel: reply with "❌ This command only works in threads!" stop
set {_owner} to thread owner of event-channel set {_count} to message count of event-channel set {_members::*} to members of event-channel
make embed: set title of embed to "Thread Statistics" set embed color of embed to blue
add field named "Created by" with value mention tag of {_owner} to fields of embed add field named "Messages" with value "%{_count}%" to fields of embed add field named "Members" with value "%size of {_members::*}%" to fields of embed
reply with last embedMember Equipped Server Tag
Section titled “Member Equipped Server Tag”Added support for retrieving a member’s equipped server tag (also called “primary guild tag”). This feature allows you to access the tag that a user has chosen to display on their profile for a specific server.
# Get the equipped server tag of a userset {_tag} to user tag of {_user}set {_tag} to user primary guild tag of {_member}
# Get the tag icon URLset {_icon} to user tag icon of {_user}set {_iconUrl} to user primary guild tag icon url of {_user}Example - Display User Tag:
discord command profile [<user>]: prefixes: ! trigger: set {_user} to arg-1 ? event-user set {_tag} to user tag of {_user}
if {_tag} is set: set {_icon} to user tag icon url of {_user} make embed: set title of embed to "%discord name of {_user}%'s Profile" set description of embed to "Equipped Tag: %discord name of {_tag}%" if {_icon} is set: set thumbnail of embed to {_icon} reply with last embed else: reply with "❌ This user has no equipped server tag."Hyphen Support in Slash Command Arguments
Section titled “Hyphen Support in Slash Command Arguments”You can now use hyphens (-) in slash command argument names for improved readability. Previously, you had to use underscores or camelCase.
Before v4.27:
# Had to use underscores or camelCaseadd new string option named "user_name" with description "Enter name" to options of {_cmd}add new integer option named "maxCount" with description "Max count" to options of {_cmd}Since v4.27:
# Now you can use hyphens for better readabilityadd new string option named "user-name" with description "Enter name" to options of {_cmd}add new integer option named "max-count" with description "Max count" to options of {_cmd}Example - Better Argument Names:
on ready: set {_cmd} to new slash command named "user-info" with description "Get information about a user"
# Use hyphens for cleaner, more readable argument names set {_userOpt} to new user option named "target-user" with description "User to check" add {_userOpt} to options of {_cmd}
set {_avatarOpt} to new boolean option named "show-avatar" with description "Show user avatar" add {_avatarOpt} to options of {_cmd}
set {_rolesOpt} to new boolean option named "include-roles" with description "Include user roles" add {_rolesOpt} to options of {_cmd}
update {_cmd} globally in event-bot
on slash command: if event-string is "user-info": set {_user} to argument "target-user" as user set {_showAvatar} to argument "show-avatar" as boolean set {_includeRoles} to argument "include-roles" as boolean
# Process command... reply with "Processing user info..."Migration Summary
Section titled “Migration Summary”-
No Breaking Changes
Version 4.27.0 is fully backward-compatible. You don’t need to modify existing code.
-
Optional Upgrades
Consider using the new features where appropriate:
- Use thread owner/message count expressions in forum handlers
- Access user tags for profile features
- Rename slash command arguments to use hyphens for better readability
-
Update DiSky
-
Restart Server
Always restart your server (don’t use
/reload) after updating
Summary
Section titled “Summary”Version 4.27.0 focuses on quality-of-life improvements:
- Thread Management: New expressions for thread owner and message count
- Server Tags: Access to equipped server tags for users
- Better Slash Commands: Hyphen support in argument names for clearer naming
All these features are non-breaking and can be adopted gradually in your existing code.
Next Steps
Section titled “Next Steps”- Learn about Forum Channels to use thread expressions
- Check out Slash Commands for argument naming
- Explore Migration to v4.26 if you haven’t upgraded yet
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