Skip to content

Commit

Permalink
Merge pull request #553 from shininome/3.1-dev
Browse files Browse the repository at this point in the history
fix telegram notification wrong when  no image
  • Loading branch information
EstrellaXD authored Oct 9, 2023
2 parents 67fbfe8 + 521d3f2 commit 86a4fd4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions backend/src/module/notification/plugin/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ def post_msg(self, notify: Notification) -> bool:
data = {
"chat_id": self.chat_id,
"caption": text,
"text": text,
"disable_notification": True,
}
photo = load_image(notify.poster_path)
if photo:
resp = self.post_files(
self.photo_url, data, files={"photo": photo}
)
resp = self.post_files(self.photo_url, data, files={"photo": photo})
else:
resp = self.post_data(self.message_url, data)
logger.debug(f"Telegram notification: {resp.status_code}")
Expand Down

0 comments on commit 86a4fd4

Please sign in to comment.