mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 11:34:18 +00:00
Correctly unregister forcestart key in mm
This commit is contained in:
parent
d907757227
commit
3138250c7f
2 changed files with 5 additions and 2 deletions
|
@ -50,7 +50,10 @@ class TelegramBot(GenericBot):
|
|||
interface.keys_callbacks[key_name] = callback
|
||||
|
||||
def unregister_keyboard_key(interface, key_name: str):
|
||||
del interface.keys_callbacks[key_name]
|
||||
try:
|
||||
del interface.keys_callbacks[key_name]
|
||||
except KeyError:
|
||||
raise KeyError(f"Key '{key_name}' is not registered")
|
||||
|
||||
return TelegramInterface
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ class MmCommand(Command):
|
|||
self.interface.unregister_keyboard_key(f"mm_{mmevent.mmid}_r_YES")
|
||||
self.interface.unregister_keyboard_key(f"mm_{mmevent.mmid}_r_LATER")
|
||||
self.interface.unregister_keyboard_key(f"mm_{mmevent.mmid}_r_NO")
|
||||
self.interface.unregister_keyboard_key(f"mm_{mmevent.mmid}_start")
|
||||
self.interface.unregister_keyboard_key(f"mm_{mmevent.mmid}_forcestart")
|
||||
|
||||
def __init__(self, interface):
|
||||
super().__init__(interface)
|
||||
|
|
Loading…
Reference in a new issue