1
+ const { Command, CommandOptions, CommandPermissions } = require ( 'axoncore' ) ;
2
+ const { Tatsu } = require ( 'tatsu' ) ;
3
+ const messages = require ( '../../../assets/joinmessages.json' ) ;
4
+ const config = require ( '../../../../configs/config.json' ) ;
5
+ const { readFileSync, writeFileSync } = require ( 'fs' ) ;
6
+
7
+ const tatsu = new Tatsu ( 'jjyo4ESeJ0-sxQ9dSRB8zmsB8edoxVuE7' ) ;
8
+
9
+ // const userRegex = /<@([^ }]+)>/g;
10
+
11
+ class Configure extends Command {
12
+ /**
13
+ * @param {import('axoncore').Module } module
14
+ */
15
+ constructor ( module ) {
16
+ super ( module ) ;
17
+
18
+ this . label = 'configure' ;
19
+ this . aliases = [ 'config' ] ;
20
+
21
+ this . hasSubcmd = false ;
22
+
23
+ this . info = {
24
+ name : 'configure' ,
25
+ description : 'Enable/disable various settings' ,
26
+ usage : 'configure [setting] [true/false]' ,
27
+ } ;
28
+
29
+ /**
30
+ * @type {CommandOptions }
31
+ */
32
+ this . options = new CommandOptions ( this , {
33
+ argsMin : 0 ,
34
+ cooldown : 1000 ,
35
+ guildOnly : true ,
36
+ } ) ;
37
+
38
+ this . permissions = new CommandPermissions ( this , {
39
+ staff : {
40
+ needed : this . axon . staff . admins ,
41
+ bypass : this . axon . staff . owners ,
42
+ } ,
43
+ } ) ;
44
+ }
45
+
46
+ async execute ( { msg, args } ) {
47
+ if ( ! args ) {
48
+ msg . channel . createMessage ( { } , { embed : {
49
+ title : 'Configuration Settings' ,
50
+ color : this . utils . getColor ( 'blue' ) ,
51
+ description : 'joinMessages\ndebugMode (disables Naga for normal users)'
52
+ } } )
53
+ } else {
54
+ config . settings [ args [ 0 ] ] = args [ 1 ] ;
55
+ switch ( config . settings [ args [ 0 ] ] ) {
56
+ case true :
57
+ this . sendSuccess ( msg . channel , `Enabled ${ args [ 0 ] } .` ) ;
58
+ break ;
59
+ case false :
60
+ this . sendSuccess ( msg . channel , `Disabled ${ args [ 0 ] } ` ) ;
61
+ break ;
62
+ }
63
+ console . log ( config . settings [ args [ 0 ] ] )
64
+ }
65
+ }
66
+ }
67
+
68
+ module . exports = Configure ;
0 commit comments