added deck.chat modules

This commit is contained in:
Luxferre
2025-12-20 21:24:56 +02:00
parent 6ee9b6ee7e
commit 1cea8cc7d2
+3 -1
View File
@@ -23,7 +23,9 @@ class DeckChat:
def command(self, command, handler): def command(self, command, handler):
""" """
Register a new handler inside the chat instance. Register a new handler inside the chat instance.
The handler accepts a single parameter, which is the state object. The handler accepts two parameters: a message and a state object,
and returns the response and the new state object.
Non-command handler is registered under the 'default' command.
""" """
cmd = command.strip().lower() cmd = command.strip().lower()
if cmd.startswith(self.command_prefix): if cmd.startswith(self.command_prefix):