diff --git a/pyobs/modules/utils/telegram.py b/pyobs/modules/utils/telegram.py index 3ba47a12..3ed56618 100644 --- a/pyobs/modules/utils/telegram.py +++ b/pyobs/modules/utils/telegram.py @@ -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)) @@ -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) @@ -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. diff --git a/pyproject.toml b/pyproject.toml index c8346561..a910432a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "pyobs-core" packages = [{ include = "pyobs" }] -version = "1.5.4" +version = "1.5.5" description = "robotic telescope software" authors = ["Tim-Oliver Husser "] license = "MIT"