File tree Expand file tree Collapse file tree 7 files changed +21
-9
lines changed Expand file tree Collapse file tree 7 files changed +21
-9
lines changed Original file line number Diff line number Diff line change 1
1
.idea /
2
2
.env
3
+ im /
3
4
node_modules /
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " monster" ,
3
- "version" : " 3.1.0 " ,
3
+ "version" : " 3.1.1 " ,
4
4
"description" : " " ,
5
5
"main" : " src/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class Command {
17
17
}
18
18
this . flags = params . flags || { } ;
19
19
this . module = null ;
20
+ this . processClass = params . processClass || Process ;
20
21
}
21
22
22
23
async filtering ( message ) {
@@ -30,7 +31,7 @@ class Command {
30
31
31
32
async exec ( message ) {
32
33
if ( await this . filtering ( message ) ) {
33
- const process = new Process ( message , this ) ;
34
+ const process = new this . processClass ( message , this ) ;
34
35
process . module = this . module ;
35
36
await process . run ( ) ;
36
37
}
Original file line number Diff line number Diff line change @@ -10,7 +10,15 @@ class Form {
10
10
async create ( channel ) {
11
11
let msgData = await this . render ( this . data ) ;
12
12
if ( typeof msgData === 'object' ) {
13
+ let file = null ;
14
+ if ( msgData . file ) {
15
+ file = msgData . file ;
16
+ delete msgData . file ;
17
+ }
13
18
msgData = { embed : msgData } ;
19
+ if ( file ) {
20
+ msgData . file = file ;
21
+ }
14
22
}
15
23
this . message = await channel . send ( msgData ) ;
16
24
return this . message ;
Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ class Process {
24
24
}
25
25
26
26
async run ( ) {
27
- this . flags = this . getFlags ( ) ;
27
+ if ( ! this . flags ) {
28
+ this . flags = this . getFlags ( ) ;
29
+ }
28
30
await this . command . handler . call ( this , this . message ) ;
29
31
this . hookContainer . clear ( ) ;
30
32
}
@@ -41,7 +43,9 @@ class Process {
41
43
42
44
if ( req . type === 'channel' ) {
43
45
const val = ( new RegExp ( `${ key } =\\<\\#(\\d+)\\>` ) ) . exec ( this . message . content ) ;
44
- res [ key ] = this . message . guild . channels . get ( val [ 1 ] ) ;
46
+ if ( val ) {
47
+ res [ key ] = this . message . guild . channels . get ( val [ 1 ] ) ;
48
+ }
45
49
} else if ( req . type === 'flag' ) {
46
50
let val = ( ( new RegExp ( `\\s${ key } (\\s+|$)` ) ) . exec ( this . message . content ) ) ;
47
51
if ( val )
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ class Processor {
6
6
constructor ( ) {
7
7
this . hookProcessor = Hook . createHookProcessor ( ) ;
8
8
this . client = new Discord . Client ( ) ;
9
- this . modules = [ ]
9
+ this . modules = [ ] ;
10
10
}
11
11
12
12
async activate ( ) {
Original file line number Diff line number Diff line change @@ -25,9 +25,6 @@ systemModule.addCommand(new Command({
25
25
} ,
26
26
async handler ( ) {
27
27
const form = await this . answer ( { ping : this . module . processor . client . ping } ) ;
28
- setTimeout ( ( ) => {
29
- form . update ( { ping : 5000 } ) ;
30
- } , 3000 )
31
28
} ,
32
29
} ) ) ;
33
30
@@ -282,7 +279,8 @@ systemModule.addCommand(new Command({
282
279
value : client . users . size ,
283
280
inline : true ,
284
281
}
285
- ]
282
+ ] ,
283
+ description : `[github](https://github.com/Sdju/monster)`
286
284
}
287
285
} ,
288
286
} ,
You can’t perform that action at this time.
0 commit comments