Skip to content
Compare
Choose a tag to compare
@Chew Chew released this 17 Feb 18:43
65ad10a

JDA-Chewtils 2.1

Welcome back to another long-awaited release! This time we have a major feature, a minor feature, and a small, quality of life feature! Let's break them down:

NOTE: JDA minimum version is now 5.3.0!

Command Contexts and User Installation

You can finally install your bot to your user and use it everywhere! Documentation for this will come at some point, but essentially you just need to use the new #contexts on your commands, like this:

To allow use of it everywhere:

this.contexts = new InteractionContextType[]{InteractionContextType.GUILD, InteractionContextType.BOT_DM, InteractionContextType.PRIVATE_CHANNEL};

We've deprecated #guilyOnly (unless you're using it for text commands still for some reason, then be free!). If you set this.guildOnly = true, it will automatically force this.contexts = new InteractionContextType[]{InteractionContextType.GUILD}, and if it is set to false, it will set this.contexts = new InteractionContextType[]{InteractionContextType.GUILD, InteractionContextType.BOT_DM}. If you want it to be unaffected, remove the this.guildOnly statement.

Add Always Respect User Permissions

On Discord, you can modify what roles a user needs to run a command. Before, the bot would always stop you, even if you wanted people without that permission to run the command. By default, forceUserPermissions = false, meaning your permissions will overwrite the bot's requests. If you demand the bot's user permissions be respected, set this to true.

What's Changed

  • Add "always respect user permissions" field by @Chew in #91
  • Make SlashCommand#getHelp() return translated text when available. by @Andre601 in #90
  • support for installation and interaction contexts by @Chew in #86

Full Changelog: 2.0...2.1