From 7b8698ffe304733dde703a9b961528587c8d1c98 Mon Sep 17 00:00:00 2001 From: shininome Date: Mon, 2 Oct 2023 12:55:46 +0800 Subject: [PATCH] test notification --- backend/src/test/test_notifucation.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 backend/src/test/test_notifucation.py diff --git a/backend/src/test/test_notifucation.py b/backend/src/test/test_notifucation.py new file mode 100644 index 00000000..9c435be0 --- /dev/null +++ b/backend/src/test/test_notifucation.py @@ -0,0 +1,18 @@ +from module.models import Notification +from module.notification.plugin.telegram import TelegramNotification + +if __name__ == "__main__": + pic_url = "https://mikanani.me/images/Bangumi/202304/4b472208.jpg" + key = "" + url = f"https://api.telegram.org/bot{key}/sendPhoto" + id = "" + data = { + "chat_id": id, + "caption": "text", + "photo": pic_url, + "disable_notification": True, + } + # requests.post(url=url,data=data) + test_notification = Notification(official_title="成神之日",season = 1,episode = 12,poster_path = pic_url) + with TelegramNotification(token=key,chat_id= id) as tn: + tn.post_msg(test_notification)