diff --git a/pyproject.toml b/pyproject.toml index 1fb0e4b0..04ad6ff7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ [tool.poetry] name = "royalnet" -version = "5.11.6" +version = "5.11.8" description = "A multipurpose bot and web framework" authors = ["Stefano Pigozzi "] license = "AGPL-3.0+" diff --git a/royalnet/serf/telegram/telegramserf.py b/royalnet/serf/telegram/telegramserf.py index 6d1ba018..312a1fb0 100644 --- a/royalnet/serf/telegram/telegramserf.py +++ b/royalnet/serf/telegram/telegramserf.py @@ -165,6 +165,12 @@ class TelegramSerf(Serf): return TelegramMessageData + def register_keyboard_key(self, identifier: str, key: rc.KeyboardKey, command: rc.Command): + self.key_callbacks[identifier] = TelegramKeyCallback(key=key, command=command) + + def unregister_keyboard_key(self, identifier: str): + del self.key_callbacks[identifier] + def callback_data_factory(self) -> Type[rc.CommandData]: # noinspection PyMethodParameters class TelegramKeyboardData(rc.CommandData):