nyxx_commands 4.4.0 copy "nyxx_commands: ^4.4.0" to clipboard
nyxx_commands: ^4.4.0 copied to clipboard

A framework for easily creating slash commands and text commands for Discord using the nyxx library.

4.4.0 #

Miscellaneous:

  • Bump analyzer to 5.7.1, args to 2.4.0, dart_style to 2.2.5, logging to 1.1.1, meta to 1.9.0, nyxx to 4.5.0, nyxx_interactions to 4.5.0, path to 1.8.3 build_runner to 2.1.0, coverage to 1.6.3, lints to 2.0.1, mockito to 5.3.2, and test to 1.23.1.

4.3.0 #

New features:

  • Added support for command localization. See localizedNames on all ICommands and localizedDescriptions for ChatCommands and the @Description() annotation.

Bug fixes:

  • Fixes @Name annotations not working when running with dart:mirrors.
  • Fixes the plugin not correctly disposing when the client is disposed.
  • Fixed the automatic response sometimes failing.

Miscellaneous:

  • Bump nyxx to 4.0.0 and nyxx_interactions to 4.3.1.

4.2.0 #

New features:

  • Added a script which allows nyxx_commands to be compiled. For more information, run dart pub global activate nyxx_commands and nyxx-compile --help.
  • Implemented support for permissions V2. See PermissionsCheck for more.

Deprecaations:

  • Deprecated AbstractCheck.permissions and all associated features.

4.2.0-dev.1 #

New features:

  • Added a script which allows nyxx_commands to be compiled. For more information, run dart pub global activate nyxx_commands and nyxx-compile --help.

4.2.0-dev.0 #

Deprecations:

  • Deprecated AbstractCheck.permissions and all associated features.

New features:

  • Added AbtractCheck.allowsDm and AbstractCheck.requiredPermissions for integrating checks with permissions v2.
  • Updated Check.deny, Check.any and Check.all to work with permissions v2.
  • Added PermissionsCheck, for checking if users have a specific permission.

Miscellaneous:

  • Bump nyxx_interactions to 4.2.0.
  • Added proper names to context type checks if none is provided.

4.1.2 #

Bug fixes:

  • Fixes an issue where slash commands nested within text-only commands would not be registered

4.1.1 #

Bug fixes:

  • Correctly export the @Autocomplete(...) annotation.

4.1.0 #

New features:

  • Support for autocompletion has been added. See Converter.autocompleteCallback and the @Autocomplete(...) annotation for more.
  • Added the ability to allow only slash commands or disable them entirely. See CommandType.def and CommandOptions.defaultCommandType for more.
  • Added ChatCommand.argumentTypes, which allows developers to access the argument types for a chat command callback.
  • Added Converter.processOptionCallback, which allows developers to modify the builder generated for a command argument.
  • Added IntConverter, DoubleConverter and NumConverter for converting numbers with custom bounds. These new classes allow you to specify a minimum and maximum value for an argument when used with @UseConverter(...).
  • Added GUildChannelConverter for converting more specific types of guild channels.

Bug fixes:

  • Fixed an issue with IContext.getButtonPress not behaving correectly when authorOnly or timeout was specified.
  • Fixed the default converters for guild channels accepting all channels in the Discord UI even if they were not the correct type.

Miscellaneous:

  • Updated the command name validation regex.
  • Bump nyxx_interactions to 4.1.0.

4.0.0 #

Breaking changes:

  • nyxx_interactions has been upgraded to 4.0.0.
  • The names of command classes have changed. The old class Command is now named ChatCommand and Group is now ChatGroup.
  • The names of context classes have changed. The old class Context is now named IChatContext, MessageContext is MessageChatContext and InteractionContext is now InteractionChatContext.
  • All deprecated members have been removed.
  • The hideOriginalResponse parameter has been removed from the ChatCommand constructor. Use the new options parameter and specify hideOriginalResponse there instead.

New features:

  • Added support for User and Message Application Commands. See the docs for UserCommand and MessageCommand for more information.
  • Added new in-built checks for validating content types.
  • Added helper methods for using nyxx_interactions with nyxx_commands.
  • Added support for the attachment command option type. Use the IAttachment type as your command callback parameter type to use the appropriate converter.

Documentation:

  • The documentation for the entire package has been rewritten, with examples, references and more. See the documentation for more details.

Bug fixes:

  • Fix a bug concerning optional arguments having their default values wrapped in futures.

4.0.0-dev.2.1 #

Bug fixes:

  • Fix a bug concerning types that didn't need to be converted being wrapped in Futures.

4.0.0-dev.2.0 #

Breaking changes:

  • Upgrade to nyxx_interactions 4.0.0.

Bug fixes

  • Fix UserCommandCheck always failing.
  • Fix parsing muultiple arguments at once leading to race conditions.
  • Fix a casting error that occurred when a text command was not found.

Documentation:

  • The documentation for the entire package has been rewritten, with examples, references and more. See the documentation for more details.

New features:

  • Added support for the attachment command option type. Use IAttachment (from nyxx_interactions) as the argument type in your commands callback for nyxx_commands to register it as an attachment command option.
  • Added IInteractionContext, an interface implemented by all contexts originating from intetractions.

4.0.0-dev.1.2 #

Bug fixes:

  • Fixed a bug affecting command syncing with external sharding.

4.0.0-dev.1.1 #

Bug fixes:

  • Fixed a bug affecting registration of slash commands nested two layers deep.

4.0.0-dev.1 #

New features:

  • Export the command types for better typing. See the documentation for ICallHooked, IChatCommandComponent, IChecked, ICommand, ICommandGroup, ICommandRegisterable and IOptions for more information.
  • Add new checks for allowing certain checks to be bypassed by certain command types. See the documentation for ChatCommandCheck, InteractionCommandCheck, InterationChatCommandCheck, MessageChatCommandCheck, MessageCommandCheck and UserCommandCheck for more info.
  • Export registerDefaultConverters and parse for users wanting to implement their own commands plugin.

4.0.0-dev.0 #

Breaking changes:

  • The names of command classes have changed. The old class Command is now named ChatCommand and Group is now ChatGroup.
  • The names of context classes have changed. The old class Context is now named IChatContext, MessageContext is MessageChatContext and InteractionContext is now InteractionChatContext.
  • All deprecated members have been removed.
  • The hideOriginalResponse parameter has been removed from the ChatCommand constructor. Use the new options parameter and specify hideOriginalResponse there instead.

If you find any more breaking changes please notify us on the official nyxx Discord server, or open an issue on GitHub.

New features:

  • Support for User Application Commands has been addded. They can be created through the UserCommand class similarly to ChatCommands, and must be added with CommandsPlugin.addCommand() as ChatCommands are.
  • Support for Message Application Commands has been addded. They can be created through the MessageCommand class similarly to ChatCommands, and must be added with CommandsPlugin.addCommand() as ChatCommands are.
  • Better support for command configuration has been added. Users can now specify options to apply only to specific commands through the options parameter in all command constructors with the new CommandOptions class. Similarly to checks, these options are inherited but can be overridden by children.
  • Added a few simple functions for easier interaction with nyxx_interactions covering common use cases for interactions.

Bug fixes:

  • Fixed an edge case issue with converters where assembled converters sometimes wouldn't return the correct type

3.3.0 #

New features:

  • Added a remaining() method to CooldownCheck to get the remaining cooldown for a context.

Deprecations:

  • registerChild has been deprecated, users should prefer the better named addCommand method.

3.2.0 #

Bug fixes:

  • Exceptions are now correctly caught for commands with async execute functions.
  • Check hooks are now correctly called when using Check.all, Check.any or Check.deny.

New features:

  • Added a new private option to Context.respond that allows users to send private responses to commands.
  • Added the ability to combine CooldownTypes using the binary OR (|) operator.
  • Added a new dmOr function that can be used in CommandsPlugin.prefix to allow users to omit the bot prefix in DMs.

3.1.1 #

Bug fixes:

  • Fixed an issue where Check.all, Check.any and Check.deny would not accept AbstractChecks as arguments.

3.1.0 #

New features:

  • Default choices for CombineConverters and FallbackConverters can now be specified in the choices parameter.
  • You can now specify the Discord slash command option type to use in Converter, CombineConverter and FallbackConverters with the type parameter.
  • Added a new hideOriginalResponse option to CommandsOptions that allows you to hide the automatic acknowledgement of interactions with autoAcknowledgeInteractions.
  • Added a new acknowledge method to InteractionContext that allows you to override hideOriginalResponse.
  • Added a new hideOriginalResponse parameter to Command constructors that allows you to override CommandsOptions.hideOriginalResponse on a per-command basis.
  • Added a new hidden parameter to InteractionContext.respond that allows you to send an ephemeral response. The hidden state of the response sent is guaranteed to match the hidden parameter, however to avoid strange behaviour it is recommended to acknowledge the interaction with InteractionContext.acknowledge if the response is delayed.
  • Added a new mention parameter to MessageContext.respond that allows you to specify whether the reply to the command should mention the user or not.
  • Added a new UseConverter decorator that allows you to override the converter used to parse a specific argument.
  • Added converters for doubles and Mentionables.
  • Added a new global mentionOr function that can be used in CommandsPlugin.prefix to allow mention prefixes.

Miscellaneous:

  • autoAcknowledgeInteractions no longer immediately acknowledges interactions upon receiving them, allowing ephemeral responses to be correctly sent.
  • Bumped nyxx_interactions to 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 Type via the discordTypes map is now deprecated. Use the type parameter in converter consutrctors instead.
  • Context.send is now deprecated as Context.respond is more appropriate for most cases. If Context.send was really what you wanted, use Context.channel.sendMessage instead.

3.0.0 #

Breaking changes:

  • The base Bot class has been replaced with a CommandsPlugin class that can be used as a plugin with nyxx 3.0.0.
  • nyxx and nyxx_interactions dependencies have been bumped to 3.0.0; versions 2.x are now unsupported.
  • BotOptions has been renamed to CommandsOptions and no longer supports the options found in ClientOptions. Create two seperate instances and pass them to NyxxFactory.createNyxx... and CommandsPlugin respectively, in the options named parameter.
  • The bot field on Context has been replaced with a client field pointing to the INyxx instance and a commands field pointing to the CommandsPlugin instance.

2.0.0 #

Breaking changes:

  • Messages sent by bot users will no longer be executed by default, see BotOptions.acceptBotCommands and BotOptions.acceptSelfCommands.

New features:

  • A new acceptBotCommands option has been added to BotOptions to allow executing commands from messages sent by other bot users.
  • A new acceptSelfCommands options has been added to BotOptions to allow executing commands from messages sent by the bot itself.
  • onPreCall and onPostCall streams on Commands and Groups can be used to register pre- and post- call hooks.
  • AbstractCheck class can be exetended to implement stateful checks.
  • CooldownCheck can be used to apply a cooldown to a command based on different criteria.
  • InteractionCheck and MessageCheck can be used with Check.any() to allow slash commands or text commands to bypass other checks.
  • Check.all() can be used to group checks.

Bug fixes:

  • Invalid cased command/group/argument names are now caught and a CommandRegistrationError is thrown.
  • StringView.escape() now correctly escapes from start to end and not start to index.

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 @Choices decorator.
  • Command arguments can now have custom names with the @Name decorator.

0.3.0 #

New features:

  • Checks now integrate with Discord's slash command permissions.
  • Checks can now be asynchronous.
  • Added RoleCheck, UserCheck and GuildCheck that 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 @Description decorator.

Breaking changes:

  • Checks are no longer a simple function.

0.2.0 #

Breaking changes:

  • Reorder description and execute parameters in Command.textOnly and Command.slashOnly constructors.
  • Remove syncDeleted option from BotOptions as nyxx_interactions removes them on sync anyways.

New features:

  • Add send(MessageBuilder) and respond(MessageBuilder) methods to Context.
  • Add children as an optional argument to Command and Group constructor.
  • Add autoAcknowledgeInteractions option to BotOptions to determine whether to automatically respond to interaction events.
  • Commands can now restrict execution using checks.

Bugfixes:

  • InteractionContext.respond will 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 Context as their first argument type.

0.1.0 #

  • Initial release.
8
likes
0
pub points
78%
popularity

Publisher

verified publisherl7ssha.xyz

A framework for easily creating slash commands and text commands for Discord using the nyxx library.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, args, dart_style, logging, meta, nyxx, nyxx_interactions, path, random_string

More

Packages that depend on nyxx_commands