mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-07-16 11:41:25 +08:00
fix telegram notification wrong when no image
This commit is contained in:
@@ -26,13 +26,12 @@ class TelegramNotification(RequestContent):
|
||||
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}")
|
||||
|
||||
Reference in New Issue
Block a user