File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,15 @@ const Cache = require('../modules/cache');
55const axios = require ( 'axios' ) . default ;
66
77class 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
You can’t perform that action at this time.
0 commit comments