Skip to content

Commit

Permalink
Merge pull request #471 from PianCat/main
Browse files Browse the repository at this point in the history
更新 Server 酱推送通道,使之适配 Server 酱³
  • Loading branch information
Sitoi authored Jan 7, 2025
2 parents 34aef6a + f79f87f commit e36284c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dailycheckin/utils/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import hmac
import json
import time
import re
from urllib.parse import quote_plus

import requests
Expand All @@ -16,9 +17,16 @@ def message2server(sckey, content):


def message2server_turbo(sendkey, content):
print("server 酱 Turbo 推送开始")
match = re.match(r'^sctp(\d+)t', sendkey)
data = {"text": "每日签到", "desp": content.replace("\n", "\n\n")}
requests.post(url=f"https://sctapi.ftqq.com/{sendkey}.send", data=data)
if match:
sc3uid = match.group(1)
print("Server 酱³ 推送开始")
url = f"https://{sc3uid}.push.ft07.com/send/{sendkey}.send?tags=DailyCheckin"
else:
print("server 酱 Turbo 推送开始")
url = f"https://sctapi.ftqq.com/{sendkey}.send"
requests.post(url=url, data=data)
return


Expand Down

0 comments on commit e36284c

Please sign in to comment.