Method to set event handler in routing table
This commit is contained in:
parent
37d2b6f3d8
commit
f1a5d244df
@ -1683,6 +1683,10 @@ class Bot(TelegramBot, ObjectWithDatabase):
|
||||
if update is not None:
|
||||
self._offset = update['update_id'] + 1
|
||||
|
||||
def set_router(self, event, handler):
|
||||
"""Set `handler` as router for `event`."""
|
||||
self.routing_table[event] = handler
|
||||
|
||||
async def route_update(self, update):
|
||||
"""Pass `update` to proper method.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user