Due to the sunsetting of Javacord, this mod migrated to JDA, which meant that introducing breaking changes was inevitable, so I chose to use this update to add more improvements that introduce breaking changes.
The naming convention of "parsables" in the documentation and changelogs have changed. These map values used as function parameters are now referred to as "schemas" or "objects". A "schema" is the format of the fields a parsable has, while an "object" will be referred to as a map value following that schema.
The following changes may break existing scripts. Make sure to update them to work with this new discarpet version.
Due to JDA having no built-in message caching, the following events were changed:
__on_discord_message_edit event now no longer provides the previous message and whether it was actually edited__on_discord_message_delete now only gives the deleted message id and the channel object instead of the message objectdc_create_threaddc_react has been split to dc_add_reaction(msg, emoji) and dc_remove_reaction(msg, emoji?, user?)dc_set_channel_topic was removed in favor of the new dc_update_channeldc_get_display_name in favor of member~'effective_name'dc_get_timeout in favor of member~'timeout_end'dc_get_user_color in favor of member~'color'dc_get_user_roles in favor of member~'roles'dc_update_presence() to replace dc_set_status() and dc_set_activity()dc_command and can be distinguished with command~'type'user~'discriminated_name, since discriminators are phased out by discordreaction~'message' with reaction~'message_id' since messages are not cached anymoreslash_command_interaction~'arguments' and slash_command_interaction~'arguments_by_name'
no longer include the subcommand and subcommand group.
Additionally, slash_command_interaction_option~'options' was removed,
since subcommand groups and subcommands are no longer expressed as nested options,
but can be retrieved using interaction~'sub_command' or ~'sub_command_group'.~'is_subcommand_or_group' in slash command interaction option values with ~'type'thread schema channel_type with is_private.reply_to to referenced_message since it can now also used to forward messagesmessage_reference_type which can be set to forward to forward messages instead of replyingcontent field optional for messages without content, like forwarded messagesfile, url, bytes, and image fields of the attachment schema have been moved to a file parsable
file field is now no longer a system file path, but a scarpet resource path, just like it is used in scarpet's read_file.bytes has been renamed to stringfile schema (see above)
thumbnail and image in embedicon in embed_author and embed_footeravatar in webhook_profile and webhook_profile_updaterALL type strings are now returned in lowercase. Additionally, the type fields of schemas are now all case-insensitive, so you can interchangeably use upper or lower case strings everywhere.
Most values returned by the ~'type' queries of values are now also different:
~'type' stringsThe types of a channel value have changed:
SERVER_TEXT_CHANNEL -> textSERVER_VOICE_CHANNEL -> voiceSERVER_FORUM_CHANNEL -> forumSERVER_STAGE_VOICE_CHANNEL -> stageSERVER_NEWS_CHANNEL -> newsSERVER_STORE_CHANNEL -> removedSERVER_PUBLIC_THREAD -> guild_public_threadSERVER_PRIVATE_THREAD -> guild_private_threadSERVER_NEWS_THREAD -> guild_news_threadPRIVATE_CHANNEL -> privateGROUP_CHANNEL -> groupCHANNEL_CATEGORY -> categorySERVER_DIRECTORY_CHANNEL -> removedmediaOther changes:
webhook~'type' CHANNEL_FOLLOWER changed to followersticker~'type' SERVER changed to guildThe component type in a component schema have partially different names now:
BUTTON -> buttonSELECT_MENU_STRING -> string_selectSELECT_MENU_USER -> user_selectSELECT_MENU_ROLE -> role_selectSELECT_MENU_MENTIONABLE -> mentionable_selectSELECT_MENU_CHANNEL -> channel_selectTEXT_INPUT -> text_inputThe style of the button schema is now no longer the color name, but the types name as discord refers to them:
BLURPLE -> primaryGREY -> secondaryGREEN -> successRED -> dangerURL -> linkslash_command_interaction~'subcommand' and slash_command_interaction~'subcommand_group'channel_types to select menu schemamention_channels, mention_emojis, mention_slash_commands, mention_here fields to allowed mentions schemamention_replied_user to allowed mentionsdc_remove_reaction(msg, emoji?, user?)message~'stripped_content'message~'stickers'emoji~'type'reaction~'channel' and reaction~'server'respond_later_data schema to third parameter of dc_respond_interaction when using type respond_later to specify ephemeral.Added a new file schema for specifying the source of a file
attachment schemafile field is now no longer a system file path, but a scarpet resource path, just like it is used in scarpet's read_file.bytes has been renamed to stringbase64 was added as a way to provide data for the filethumbnail and image in embedicon in embed_author and embed_footeravatar in webhook_profile and webhook_profile_updaterfile, url, bytes and image fields of the attachment field have been replaced with a single file field.Added dc_member value type, referencing a user in a server.
This can be used to retrieve data of a user specific to a server, like nicknames and roles.
In order to retrieve this value, the following has been added:
message~'member'message~'member'interaction~'member'role~'members'server~'members'channel~'positiondc_member_from_user(user, server) function for retrieving a member from the user and server.dc_update_channel, replacing dc_set_channel_topic, allowing to update many options of channels.channel_updater schema.
Fabric carpet extension that adds discord functionality to scarpet