Skip to content

Commit

Permalink
Update API URL to compatible with the latest version of ServerChan (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
easychen authored Oct 22, 2024
1 parent c01494e commit d2f71d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/notification-providers/serverchan.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ class ServerChan extends NotificationProvider {
const okMsg = "Sent Successfully.";

// serverchan3 requires sending via ft07.com
const url = String(notification.serverChanSendKey).startsWith("sctp")
? `https://${notification.serverChanSendKey}.push.ft07.com/send`
const matchResult = String(notification.serverChanSendKey).match(/^sctp(\d+)t/i);
const url = matchResult && matchResult[1]
? `https://${matchResult[1]}.push.ft07.com/send/${notification.serverChanSendKey}.send`
: `https://sctapi.ftqq.com/${notification.serverChanSendKey}.send`;

try {
Expand Down

0 comments on commit d2f71d1

Please sign in to comment.