mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 11:34:18 +00:00
➕ Add non-data methods to register and unregister keyboard keys
This commit is contained in:
parent
014ebc7f51
commit
7d81510fed
2 changed files with 7 additions and 1 deletions
|
@ -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 <ste.pigozzi@gmail.com>"]
|
||||
license = "AGPL-3.0+"
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue