yyds 2022-02-18 18:51:45 +08:00
parent 70bc7c8f6b
commit bf694e2d0b
1 changed files with 8 additions and 11 deletions

View File

@ -1676,18 +1676,15 @@ function gotifyNotify(text, desp) {
function gobotNotify(text, desp, time = 2100) { function gobotNotify(text, desp, time = 2100) {
return new Promise((resolve) => { return new Promise((resolve) => {
if (GOBOT_URL) { if (GOBOT_URL) {
const options = { const options = {
url: `${GOBOT_URL}?access_token=${GOBOT_TOKEN}&${GOBOT_QQ}`, url: `${GOBOT_URL}?access_token=${GOBOT_TOKEN}&${GOBOT_QQ}&message=标题:${encodeURIComponent(text+"\n")}内容:${encodeURIComponent(desp)}`,
json: { headers: {
message: `${text}\n${desp}` 'Content-Type': 'application/x-www-form-urlencoded',
}, },
headers: { timeout,
'Content-Type': 'application/json', };
},
timeout,
};
setTimeout(() => { setTimeout(() => {
$.post(options, (err, resp, data) => { $.get(options, (err, resp, data) => {
try { try {
if (err) { if (err) {
console.log('发送go-cqhttp通知调用API失败\n'); console.log('发送go-cqhttp通知调用API失败\n');