Queer European MD passionate about IT
Browse Source

Method to set event handler in routing table

Davte 5 years ago
parent
commit
f1a5d244df
1 changed files with 4 additions and 0 deletions
  1. 4 0
      davtelepot/bot.py

+ 4 - 0
davtelepot/bot.py

@@ -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.