File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -25,14 +25,18 @@ client.commands = new Discord.Collection();
25
25
// Get command files
26
26
const commandFiles = fs . readdirSync ( './commands' ) . filter ( file => file . endsWith ( '.js' ) ) ;
27
27
28
- for ( const file of commandFiles ) {
29
- const command = require ( `./commands/${ file } ` ) ;
28
+ console . log ( commandFiles . isArray ) ;
29
+
30
+ console . log ( "Attemping to load commands in the commands folder." )
31
+
32
+ commandFiles . forEach ( function ( file , i ) {
33
+ const command = require ( `./commands/${ file } ` ) ;
34
+ console . log ( `${ file } Loaded (${ i + 1 } /${ commandFiles . length } )` ) ;
30
35
31
36
// set a new item in the Collection
32
37
// with the key as the command name and the value as the exported module
33
38
client . commands . set ( command . name , command ) ;
34
- }
35
-
39
+ } ) ;
36
40
37
41
38
42
// when the client is ready, run this code
@@ -62,7 +66,7 @@ client.on('message', async (message) => {
62
66
// child_process commands go here
63
67
64
68
// ignore messages without prefixes and messages from the bot itself
65
- if ( ! message . content . startsWith ( process . env . PREFIX ) || message . author . bot ) return ;
69
+ if ( ! message . content . startsWith ( process . env . PREFIX ) || message . author . bot ) return ;
66
70
67
71
// slices of the prefix and splits message into an array
68
72
const args = message . content . slice ( process . env . PREFIX . length ) . split ( ' ' ) ;
You can’t perform that action at this time.
0 commit comments