Make Dispatcher._run_polling public

This commit is contained in:
Alex Root Junior 2019-12-26 00:00:53 +02:00
parent 1d2c6c91d0
commit a2cb637ed9
3 changed files with 8 additions and 8 deletions

View file

@ -151,7 +151,7 @@ class Dispatcher(Router):
async for update in self._listen_updates(bot):
await self.process_update(update=update, bot=bot, **kwargs)
async def _run_polling(self, *bots: Bot, **kwargs: Any) -> None:
async def start_polling(self, *bots: Bot, **kwargs: Any) -> None:
"""
Polling runner
@ -188,7 +188,7 @@ class Dispatcher(Router):
:return:
"""
try:
return asyncio.run(self._run_polling(*bots, **kwargs))
return asyncio.run(self.start_polling(*bots, **kwargs))
except (KeyboardInterrupt, SystemExit): # pragma: no cover
# Allow to graceful shutdown
pass