v1.0.0-alpha5
This adds official support for Javacord 3.5.0 with the following changes:
NexusObserver
which was the legacy and deprecated slash command synchronizer for Nexus is now removed, please use yournexus.getSynchronizer()
instead which is more configurable and faster.- All calls to
InteractionCallbackFlag
is now replaced withMessageFlag
- Adds support for the new slash command version 2.0 permissions, read below for more information.
- Adds support for slash command localization, read below for more information.
⚔️ Slash Command Permissions V2
Nexus supports most if not all the new APIs from Javacord's slash command permissions with the following new fields added to the command schema (default values are as specified below):
const val enabledInDms: Boolean = true;
const val defaultDisabled: Boolean = false;
val defaultEnabledForPermissions: List<PermissionType> = emptyList();
- enabledInDms: Enables or disables the command on user's private messages, setting this to false will hide this command from the private messages.
- defaultDisabled: Disables the command globally, it will make this command hidden from all users other than the admin of the server.
- defaultEnabledForPermissions: Enables this command by default for people with the given permissions, can be overriden by the server owners or administrators.
(there is also one field that was added which is defaultEnabledForEveryone
but that's sort of just there for no reason and is ignored once defaultDisabled
is set to true).
🌏 Slash Command Localizations
A basic support for slash command localization has been implemented, note that this is the bare basic support since there are no plans so far to go beyond the APIs provided by Javacord. This adds the following new fields to the command schema (default values are as specified below):
val nameLocalizations: Map<DiscordLocale, String> = emptyMap()
val descriptionLocalizations: Map<DiscordLocale, String> = emptyMap()
- nameLocalizations: Adds a new localization value for the name, this should be paired with a localized description as well.
- descriptionLocalizations: Adds a new localization value for the description, this should be paired with a localized name as well.
You can access these values as well during command event execution, for example, we want to get the description value or the name value of a locale during command execution (for whatever reason):
override fun onEvent(event: NexusCommandEvent) {
const name = event.command.getNameLocalization(DiscordLocale.JAPANESE);
}
📦 Installation with Jitpack
You can find all the dependency managers installation on the link here: https://jitpack.io/#pw.mihou/Nexus/1.0.0-alpha5