This repository was archived by the owner on Sep 9, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +18
-34
lines changed Expand file tree Collapse file tree 6 files changed +18
-34
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ COPY src $APP/src
18
18
19
19
WORKDIR $APP
20
20
21
- CMD [ "pm2-runtime" , "src/index .js" ]
21
+ CMD [ "pm2-runtime" , "src/ShardingMgr .js" ]
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " psybot" ,
3
3
"version" : " 1.0.0" ,
4
- "main" : " src/index .js" ,
4
+ "main" : " src/ShardingMgr .js" ,
5
5
"keywords" : [
6
6
" discord" ,
7
7
" bot" ,
19
19
},
20
20
"scripts" : {
21
21
"prestart" : " npm install" ,
22
- "start" : " node src/index .js"
22
+ "start" : " node src/ShardingMgr .js"
23
23
},
24
24
"author" : " void*" ,
25
25
"license" : " GPLv3" ,
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ class Bot extends Commando.Client {
9
9
constructor ( token , ownerid , commandprefix ) {
10
10
super ( {
11
11
"owner" : ( ownerid ) ? ownerid : null ,
12
- "commandPrefix" : ( commandprefix ) ? commandprefix : '$ ' ,
12
+ "commandPrefix" : ( commandprefix ) ? commandprefix : '- ' ,
13
13
"intents" : myIntents
14
14
} ) ;
15
15
this . token = token ;
@@ -28,7 +28,6 @@ class Bot extends Commando.Client {
28
28
} ) ;
29
29
30
30
this
31
- . on ( "debug" , console . log )
32
31
. on ( "warn" , console . log )
33
32
34
33
// register default groups and commands
Original file line number Diff line number Diff line change
1
+ const configName = process . env . CONFIG_NAME || 'config.json' ;
2
+ const config = require ( './' + configName ) ;
3
+
4
+ const { ShardingManager} = require ( 'discord.js' ) ;
5
+
6
+ const manager = new ShardingManager ( './src/index.js' , {
7
+ totalShards : 'auto' ,
8
+ token : config . general . token
9
+ } ) ;
10
+
11
+ manager . on ( 'shardCreate' , ( shard ) => console . log ( `Shard ${ shard . id } launched` ) ) ;
12
+
13
+ manager . spawn ( ) ;
Original file line number Diff line number Diff line change 2
2
"general" : {
3
3
"token" : " " ,
4
4
"ownerID" : [" " ],
5
- "globalCommandPrefix" : " " ,
5
+ "globalCommandPrefix" : " - " ,
6
6
"deleteCommandMessages" : false
7
7
}
8
8
}
You can’t perform that action at this time.
0 commit comments