20 lines
845 B
Python
20 lines
845 B
Python
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() |