Skip to content

Commit 460d1e8

Browse files
author
im3x-dev
committed
[x] w7 cookie
1 parent 3a9156c commit 460d1e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

plugins/w7_message.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ const Cache = require('../modules/cache');
55
const axios = require('axios').default;
66

77
class Plugin extends Bot {
8+
constructor () {
9+
this.COOKIE = process.env.w7_cookie;
10+
if (!this.COOKIE) return this.exit();
11+
}
812
run () {
913
const cache = new Cache();
10-
const cookie = process.env.w7_cookie;
1114
axios.get('https://user.w7.cc/v1/message/list?page=1', {
1215
headers: {
13-
'Cookie': cookie
16+
'Cookie': this.COOKIE
1417
}
1518
}).then(res => {
1619
const { data } = res.data;
@@ -21,7 +24,6 @@ class Plugin extends Bot {
2124
this.sendMarkdown(`# ${d.type_text}\n> ${d.create_date_format}\n\n${d.detail}`);
2225
cache.set(d.createtime, "ok");
2326
});
24-
// this.sendText("ok");
2527
}
2628
}
2729

0 commit comments

Comments
 (0)