diff --git a/CHANGELOG.md b/CHANGELOG.md index 6876a58..cfa81a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.0.3 +__Bug fixes__ +- Expose the arguments list of the `execute` function (#154) +- Fix crash when no permission overrides are present in a guild (#155) + ## 6.0.2 __Bug fixes__ - Fixed autocompletion in commands in chat groups diff --git a/lib/nyxx_commands.dart b/lib/nyxx_commands.dart index 3bc1c58..5cf6b60 100644 --- a/lib/nyxx_commands.dart +++ b/lib/nyxx_commands.dart @@ -29,9 +29,6 @@ export 'src/commands/message_command.dart' show MessageCommand; export 'src/commands/options.dart' show CommandOptions; export 'src/commands/user_command.dart' show UserCommand; export 'src/context/autocomplete_context.dart' show AutocompleteContext; -export 'src/context/chat_context.dart' - show ChatContext, ChatContextData, InteractionChatContext, MessageChatContext; -export 'src/context/context_manager.dart' show ContextManager; export 'src/context/base.dart' show CommandContext, @@ -43,6 +40,11 @@ export 'src/context/base.dart' InteractionInteractiveContext, InteractiveContext, ResponseLevel; +export 'src/context/chat_context.dart' + show ChatContext, ChatContextData, InteractionChatContext, MessageChatContext; +export 'src/context/component_context.dart' + show ComponentContextData, ComponentContext, ButtonComponentContext, SelectMenuContext; +export 'src/context/context_manager.dart' show ContextManager; export 'src/context/message_context.dart' show MessageContext; export 'src/context/modal_context.dart' show ModalContext; export 'src/context/user_context.dart' show UserContext; diff --git a/lib/src/checks/permissions.dart b/lib/src/checks/permissions.dart index 4c2388d..479fd84 100644 --- a/lib/src/checks/permissions.dart +++ b/lib/src/checks/permissions.dart @@ -88,7 +88,10 @@ class PermissionsCheck extends Check { if (overrides.permissions.isEmpty) { overrides = (await context.client.guilds[context.guild!.id].commands.listPermissions()) - .singleWhere((overrides) => overrides.command == null); + .singleWhere( + (overrides) => overrides.command == null, + orElse: () => overrides, + ); } bool? def; diff --git a/lib/src/commands/chat_command.dart b/lib/src/commands/chat_command.dart index 25f60e8..e732a40 100644 --- a/lib/src/commands/chat_command.dart +++ b/lib/src/commands/chat_command.dart @@ -279,8 +279,12 @@ class ChatCommand final List singleChecks = []; /// The types of the required and positional arguments of [execute], in the order they appear. + @Deprecated('Use arguments[].type instead') final List> argumentTypes = []; + /// The arguments of [execute], in the order they appear. + final List> arguments = []; + @override final CommandOptions options; @@ -368,7 +372,9 @@ class ChatCommand } } + // ignore: deprecated_member_use_from_same_package argumentTypes.add(parameter.type); + arguments.add(parameter); } } diff --git a/pubspec.yaml b/pubspec.yaml index a23c14e..301f8e5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: nyxx_commands -version: 6.0.2 +version: 6.0.3 description: A framework for easily creating slash commands and text commands for Discord using the nyxx library. homepage: https://github.com/nyxx-discord/nyxx_commands/blob/main/README.md