pooling update handlers, add overlay bot module

This commit is contained in:
2019-11-16 03:38:12 +03:00
parent 06d79850ac
commit 752256be7b
8 changed files with 117 additions and 14 deletions

View File

@@ -23,10 +23,11 @@ class TelegramBot(models.Model):
def get_bot(self):
return Bot(self.bot_token)
def build_dispatcher(self):
def build_dispatcher(self, error_handler):
bot = self.get_bot()
bot.get_me()
dispatcher = Dispatcher(bot, None, workers=0, use_context=True)
dispatcher.add_error_handler(error_handler)
self.config.build_dispatcher(dispatcher)
return dispatcher