From e04c4d05daeffb97600515ac4ed6df8e63dad6de Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 8 Apr 2018 16:42:47 +0300 Subject: [PATCH] Fix unwanted disabling webhook when skip_updates is enabled. --- aiogram/utils/executor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiogram/utils/executor.py b/aiogram/utils/executor.py index cc53ba6e..62e1cd1e 100644 --- a/aiogram/utils/executor.py +++ b/aiogram/utils/executor.py @@ -11,15 +11,15 @@ async def _startup(dispatcher: Dispatcher, skip_updates=False, callback=None): user = await dispatcher.bot.me log.info(f"Bot: {user.full_name} [@{user.username}]") - if callable(callback): - await callback(dispatcher) - if skip_updates: await dispatcher.reset_webhook(True) count = await dispatcher.skip_updates() if count: log.warning(f"Skipped {count} updates.") + if callable(callback): + await callback(dispatcher) + async def _wh_startup(app): callback = app.get('_startup_callback', None)