Migrate to V5¶
With V4 we have made a clean cut during development to finally have a stable release. However, V4 is based on JDA 5 and doesn't have support for Components V2 or Modals. With JDA-Commands V5, we finally support these features. But as always, some things have changed in the meantime. This guide will help you to migrate from V4 to V5.
New Features¶
- You can now reply with Components V2
- The Modal API has changed to also support CV2
- The new Introspection API allows you to access JDA-Commands' properties and event system
- The Reply Config now supports JDA's
setSuppresedNotificationsandsetAllowedMentions - Command Choices can now be dynamically loaded
IMentionableobjects now will be automatically localized- You can now update the guild commands for a specific guild
- You can now add custom String Resolvers to the localization system
Note
You can find the full changelog here
Changes¶
- After calling
MessageReply#embeds(String...),MessageReply#components(String...)orMessageReply#builder(Consumer)you can no longer access theConfigurableReply InteractionDefinition.ReplyConfig#editReply(),InteractionDefinition.ReplyConfig#keepComponents()andInteractionDefinition.ReplyConfig#keepSelections()can now only be called on aComponentEvent- The
ErrorMessageFactorynow uses Components V2. It has to return aMessageTopLevelComponentinstead ofMessageCreateData - The
DefaultErrorMessageFactorynow uses Components V2 - Removed
EmbedConfig#errorSource() - Removed
Event#i18n(), useEvent#messageResolver()instead
Renaming¶
ErrorMessageFactory#getCommandExecutionFailedMessage()->ErrorMessageFactory#getInteractionExecutionFailedMessage(ErrorMessageFactory.ErrorContext, Throwable)@EntitySelectMenu-> <@EntityMenu>@StringSelectMenu-> <@StringMenu>Event#localize->Event#resolve(String, Entry...)Priority#PERMISSIONS->Priority#HIGHEST