v3.0.0-alpha.24 | User-installable apps, jda-emojis
Overview
Added user-installable apps and jda-emojis.
Note: This should be the last V3 alpha.
User-installable apps (#163)
These will allow you to use interactions anywhere on Discord, by installing them on users directly instead of guilds.
You can read more about them on the JDA release notes.
After installing your app on the user, allowing a command to be installed on the user requires you to add USER_INSTALL
to the integrationTypes
property of your top level command.
Then, you can define the contexts
property (again, on the top-level command), this property defines where the command can be used (Guild, Bot DMs, Friend DMs, Group DMs).
You can also check out the wiki for more details.
Breaking changes
-
Meaning of
CommandScope#GLOBAL
has changed, it previously meant having a command accessible on both the installed Guild, and the Bot's DMs
However, since then, it only specifies the scope on which the command is added.If you have used this scope, you will likely get a warning which recommends you to use the "Guild" variant of the event,
to fix this and restore previous behavior, you will need to addInteractionContextType.GUILD
andInteractionContextType.BOT_DM
in thecontexts
property, alongside your existingscope = CommandScope.GLOBAL
.Kotlin example:
@TopLevelSlashCommandData(scope = CommandScope.GLOBAL) @JDASlashCommand(name = "foo") fun onSlashFoo(event: GlobalSlashEvent) { }
when updating to 3.0.0-alpha.24, becomes:
// Same as @TopLevelSlashCommandData(scope = CommandScope.GLOBAL, contexts = [InteractionContextType.GUILD, InteractionContextType.BOT_DM]) @TopLevelSlashCommandData(contexts = [InteractionContextType.GUILD, InteractionContextType.BOT_DM]) @JDASlashCommand(name = "foo") fun onSlashFoo(event: GlobalSlashEvent) { }
Deprecations
- Deprecated
CommandScope#GLOBAL_NO_DM
, setcontexts
on your top-level command toInteractionContextType.GUILD
instead - Deprecated
CommandScope
in code-declared commands, use interaction contexts instead
New features
- Can now set interaction contexts (where a command can run)
- Can now set integration types (where a command can be installed)
- Default integration types and interaction contexts can be changed
- In
GuildApplicationCommandManager
for guild-scoped commands - In
GlobalApplicationCommandManager
for global-scoped commands - These defaults apply for both annotated and code-declared commands
- In
Added jda-emojis
(#229)
This library was added to allow a more seamless usage of emojis in your JDA code.
When you previously had to take the proper Unicode manually, or using JEmoji and converting to JDA's UnicodeEmoji
, you can now directly take the same emoji Discord supports, from Emojis
(in the dev.freya02.jda.emojis.unicode
package) or UnicodeEmojis
.
Remember, if you are converting from JEmoji to jda-emojis, you will find the emoji names using Discord's names.
Check out the wiki for more details.
Deprecations
ButtonContent
:fromUnicode
,fromShortcode
New features
- Added an
withEmoji
overload with JDA'sEmoji
inButtonContent
/ButtonFactory
(when building a button)
New features
Components
- Added
withDisabled
onButtonContent
andButtonFactory
- This allows disabling a component before it is built
Don't hesitate to check out the examples and the wiki.
Full Changelog: v3.0.0-alpha.23...v3.0.0-alpha.24