init: Initial commit
This commit is contained in:
20
modules/command.py
Normal file
20
modules/command.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from botbuilder.core import TurnContext
|
||||
|
||||
from commands.test import TestCommand
|
||||
from commands.webhook import WebhookCommand
|
||||
from commands.help import HelpCommand
|
||||
from modules.database import DatabaseManager
|
||||
|
||||
class Command:
|
||||
def __init__(self, turn_context: TurnContext, database: DatabaseManager) -> None:
|
||||
self.turn_context = turn_context
|
||||
self.database = database
|
||||
|
||||
async def handle_command(self, command: str, message: str | None = None) -> None:
|
||||
match command:
|
||||
case "test":
|
||||
await TestCommand(self.database).handle_test(self.turn_context, command, message)
|
||||
case "webhooks":
|
||||
await WebhookCommand(self.database).handle_list_webhooks(self.turn_context)
|
||||
case _:
|
||||
await HelpCommand(self.turn_context, self.database).handle_help()
|
||||
Reference in New Issue
Block a user