Skip to content

Commit

Permalink
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions pyobs/modules/utils/telegram.py
Original file line number Diff line number Diff line change
@@ -66,7 +66,6 @@ async def open(self) -> None:

# get dispatcher
self._application = Application.builder().token("TOKEN").build()
dispatcher = self._updater.dispatcher # type: ignore

# add command handler
self._application.add_handler(CommandHandler("start", self._command_start))
@@ -83,9 +82,9 @@ async def open(self) -> None:

# load storage file
try:
dispatcher.bot_data["storage"] = await self.vfs.read_yaml("/pyobs/telegram.yaml")
self._application.bot_data["storage"] = await self.vfs.read_yaml("/pyobs/telegram.yaml")
except FileNotFoundError:
dispatcher.bot_data["storage"] = {}
self._application.bot_data["storage"] = {}

# start polling
self._application.start_polling(poll_interval=0.1)
@@ -509,7 +508,7 @@ async def _process_log_entry(self, entry: Event, sender: str) -> bool:
# get storage
if self._application is None:
raise ValueError("No update initialised.")
s = self._updater.dispatcher.bot_data["storage"] # type: ignore
s = self._application.bot_data["storage"] # type: ignore

# loop users
for user_id, user in s["users"].items():
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "pyobs-core"
packages = [{ include = "pyobs" }]
version = "1.5.3"
version = "1.5.4"
description = "robotic telescope software"
authors = ["Tim-Oliver Husser <thusser@uni-goettingen.de>"]
license = "MIT"

0 comments on commit 8e2fa96

Please sign in to comment.