diff --git a/telegram/commands/__init__.py b/telegram/commands/__init__.py index 8bbd6a8..8c1b50a 100644 --- a/telegram/commands/__init__.py +++ b/telegram/commands/__init__.py @@ -2,6 +2,8 @@ from dataclasses import dataclass import typing from aiogram import Dispatcher +from aiogram.types import Message + from .test import telegram_test @@ -21,4 +23,5 @@ handlers: dict[str, Handler] = { def register_handlers(dispatcher: Dispatcher): for command, handler in handlers.items(): - dispatcher.register_message_handler(handler, commands=[command]) + dispatcher.register_message_handler(handler.function, + commands=[command])