Fix unwanted disabling webhook when skip_updates is enabled.

This commit is contained in:
Alex Root Junior 2018-04-08 16:42:47 +03:00
parent d2c5896b5c
commit e04c4d05da

View file

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