forked from neostant/SCP-Foundation-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
23 lines (19 loc) · 747 Bytes
/
index.js
File metadata and controls
23 lines (19 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const path = require('path')
const request = require('request-promise')
const Discord = require('discord.js')
const express = require("express");
const app = express();
const shardingManager = new Discord.ShardingManager(path.join(__dirname, 'bot.js'), {
token: process.env.BOT_TOKEN,
totalShards: 'auto',
shardArgs: typeof v8debug === 'object' ? ['--inspect'] : undefined,
execArgv: ['--trace-warnings']
})
shardingManager.on('shardCreate', shard => {
console.log(`Launching shard ${shard.id + 1}/${shardingManager.totalShards}`)
})
shardingManager.spawn('auto', 8000, -1)
// listen for requests :)
const listener = app.listen(process.env.PORT, () => {
console.log("Your app is listening on port " + listener.address().port);
});