Parcourir la source

Fix handling of commands in GPTBot class

Kumi il y a 1 an
Parent
commit
37a1e6a85c
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      src/gptbot/classes/bot.py

+ 3 - 3
src/gptbot/classes/bot.py

@@ -321,9 +321,9 @@ class GPTBot:
         )
 
         if event.body.startswith("* "):
-            event.body = event.body[2:]
-
-        command = event.body.split()[1] if event.body.split()[1:] else None
+            command = event.body[2:].split()[1] if event.body.split()[1:] else None
+        else:
+            command = event.body.split()[1] if event.body.split()[1:] else None
 
         await COMMANDS.get(command, COMMANDS[None])(room, event, self)