From b544e52a6a4bb0962f2a7487ca56fc9d57acf614 Mon Sep 17 00:00:00 2001 From: Szymon Uglis Date: Mon, 28 Oct 2024 20:55:05 +0100 Subject: [PATCH] Move onMessageCreate listener --- lib/src/commands.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/commands.dart b/lib/src/commands.dart index 8b1aa12..8c5b665 100644 --- a/lib/src/commands.dart +++ b/lib/src/commands.dart @@ -191,6 +191,14 @@ class CommandsPlugin extends NyxxPlugin implements CommandGroup event.interaction); onApplicationCommandAutocompleteInteraction = client.onApplicationCommandAutocompleteInteraction.map((event) => event.interaction); + + client.onMessageCreate.listen((event) async { + try { + await eventManager.processMessageCreateEvent(event); + } on CommandsException catch (e) { + _onCommandErrorController.add(e); + } + }); } else { throw ArgumentError(); } @@ -276,14 +284,6 @@ class CommandsPlugin extends NyxxPlugin implements CommandGroup