Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
thusser committed Sep 20, 2023
1 parent dd9c452 commit 6088b9b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyobs/modules/utils/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async def open(self) -> None:
self._loop = asyncio.get_running_loop()

# get dispatcher
self._application = Application.builder().token("TOKEN").build()
self._application = Application.builder().token(self._token).build()

# add command handler
self._application.add_handler(CommandHandler("start", self._command_start))
Expand All @@ -87,7 +87,9 @@ async def open(self) -> None:
self._application.bot_data["storage"] = {}

# start polling
self._application.start_polling(poll_interval=0.1)
await self._application.initialize()
await self._application.updater.start_polling()
await self._application.start()

# listen to log events
await self.comm.register_event(LogEvent, self._process_log_entry)
Expand All @@ -98,7 +100,9 @@ async def close(self) -> None:

# stop telegram
if self._application is not None:
await self._application.updater.stop()
await self._application.stop()
await self._application.shutdown()

async def _save_storage(self, context: CallbackContext) -> None:
"""Save storage file.
Expand Down

0 comments on commit 6088b9b

Please sign in to comment.