nyxx_commands 3.3.0
nyxx_commands: ^3.3.0 copied to clipboard
A framework for easily creating slash commands and text commands for Discord using the nyxx library.
3.3.0 #
New features:
- Added a
remaining()method toCooldownCheckto get the remaining cooldown for a context
Deprecations:
registerChildhas been deprecated, users should prefer the better namedaddCommandmethod
3.2.0 #
Bug fixes:
- Exceptions are now correctly caught for commands with async
executefunctions. - Check hooks are now correctly called when using
Check.all,Check.anyorCheck.deny
New features:
- Added a new
privateoption toContext.respondthat allows users to send private responses to commands - Added the ability to combine
CooldownTypesusing the binary OR (|) operator - Added a new
dmOrfunction that can be used inCommandsPlugin.prefixto allow users to omit the bot prefix in DMs
3.1.1 #
Bug fixes:
- Fixed an issue where
Check.all,Check.anyandCheck.denywould not acceptAbstractChecks as arguments.
3.1.0 #
New features:
- Default choices for
CombineConverters andFallbackConverters can now be specified in thechoicesparameter - You can now specify the Discord slash command option type to use in
Converter,CombineConverterandFallbackConverters with thetypeparameter - Added a new
hideOriginalResponseoption toCommandsOptionsthat allows you to hide the automatic acknowledgement of interactions withautoAcknowledgeInteractions - Added a new
acknowledgemethod toInteractionContextthat allows you to overridehideOriginalResponse - Added a new
hideOriginalResponseparameter toCommandconstructors that allows you to overrideCommandsOptions.hideOriginalResponseon a per-command basis - Added a new
hiddenparameter toInteractionContext.respondthat allows you to send an ephemeral response. The hidden state of the response sent is guaranteed to match thehiddenparameter, however to avoid strange behaviour it is recommended to acknowledge the interaction withInteractionContext.acknowledgeif the response is delayed - Added a new
mentionparameter toMessageContext.respondthat allows you to specify whether the reply to the command should mention the user or not - Added a new
UseConverterdecorator that allows you to override the converter used to parse a specific argument - Added converters for
doubles andMentionables - Added a new global
mentionOrfunction that can be used inCommandsPlugin.prefixto allow mention prefixes
Miscellaneous:
autoAcknowledgeInteractionsno longer immediately acknowledges interactions upon receiving them, allowing ephemeral responses to be correctly sent- Bumped
nyxx_interactionsto 3.1.0 - Argument parsing is now done in parallel, making commands with multiple arguments faster to invoke
Deprecations:
- Setting the Discord slash command option type to use for a Dart
Typevia thediscordTypesmap is now deprecated. Use thetypeparameter in converter consutrctors instead Context.sendis now deprecated asContext.respondis more appropriate for most cases. IfContext.sendwas really what you wanted, useContext.channel.sendMessageinstead
3.0.0 #
Breaking changes:
- The base
Botclass has been replaced with aCommandsPluginclass that can be used as a plugin with nyxx3.0.0 nyxxandnyxx_interactionsdependencies have been bumped to3.0.0; versions2.xare now unsupportedBotOptionshas been renamed toCommandsOptionsand no longer supports the options found inClientOptions. Create two seperate instances and pass them toNyxxFactory.createNyxx...andCommandsPluginrespectively, in theoptionsnamed parameter- The
botfield onContexthas been replaced with aclientfield pointing to theINyxxinstance and acommandsfield pointing to theCommandsPlugininstance.
2.0.0 #
Breaking changes:
- Messages sent by bot users will no longer be executed by default, see
BotOptions.acceptBotCommandsandBotOptions.acceptSelfCommands
New features:
- A new
acceptBotCommandsoption has been added toBotOptionsto allow executing commands from messages sent by other bot users - A new
acceptSelfCommandsoptions has been added toBotOptionsto allow executing commands from messages sent by the bot itself onPreCallandonPostCallstreams onCommandsandGroupscan be used to register pre- and post- call hooksAbstractCheckclass can be exetended to implement stateful checksCooldownCheckcan be used to apply a cooldown to a command based on different criteriaInteractionCheckandMessageCheckcan be used withCheck.any()to allow slash commands or text commands to bypass other checksCheck.all()can be used to group checks
Bug fixes:
- Invalid cased command/group/argument names are now caught and a
CommandRegistrationErroris thrown StringView.escape()now correctly escapes fromstarttoendand notstarttoindex
1.0.0 #
- Version 1 was skipped to keep version consistent with the other nyxx libraries
0.4.0 #
Breaking changes:
- Exceptions have been reworked and are no longer named the same
New features:
- Converters can now specify pre-defined choices for their type, this behaviour can be overridden on a per-command basis with the
@Choicesdecorator - Command arguments can now have custom names with the
@Namedecorator
0.3.0 #
New features:
- Checks now integrate with Discord's slash command permissions
- Checks can now be asynchronous
- Added
RoleCheck,UserCheckandGuildCheckthat represent the basic Discord slash command permissions: role restricted, user restricted and guild restricted (guild command) - Slash command arguments can have descriptions set with the
@Descriptiondecorator
Breaking changes:
- Checks are no longer a simple function
0.2.0 #
Breaking changes:
- Reorder
descriptionandexecuteparameters inCommand.textOnlyandCommand.slashOnlyconstructors. - Remove
syncDeletedoption fromBotOptionsas nyxx_interactions removes them on sync anyways.
New features:
- Add
send(MessageBuilder)andrespond(MessageBuilder)methods toContext - Add
childrenas an optional argument toCommandandGroupconstructor - Add
autoAcknowledgeInteractionsoption toBotOptionsto determine whether to automatically respond to interaction events - Commands can now restrict execution using checks
Bugfixes:
InteractionContext.respondwill no longer throw an error when responding immediately- Slash Commands can no longer have direct slash command children
- Errors emitted outside of argument parsing and callback execution are now correctly sent to
Bot.onCommandError
Miscellaneous:
- Text-only and slash-only commands can now have
Contextas their first argument type
0.1.0 #
- Initial release