mirror of https://github.com/thaldrin/thaldrin.git
spawn
This commit is contained in:
parent
3fd6c2af99
commit
528a579e43
|
@ -0,0 +1,17 @@
|
||||||
|
import { Discord } from "./src/modules/eu/src/index"
|
||||||
|
import path from "path"
|
||||||
|
import config from "./src/utils/config"
|
||||||
|
import { Intents } from "./src/modules/eu/src/misc/imports"
|
||||||
|
// @ts-ignore
|
||||||
|
import modulus from "./src/utils/modulus"
|
||||||
|
|
||||||
|
|
||||||
|
const Bot = new Discord.Client({
|
||||||
|
// @ts-ignore
|
||||||
|
token: config.tokens.discord,
|
||||||
|
commands: path.join(__dirname, "src", "discord", "commands"),
|
||||||
|
events: path.join(__dirname, "src", "discord", "events"),
|
||||||
|
options: {
|
||||||
|
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES]
|
||||||
|
}
|
||||||
|
})
|
|
@ -0,0 +1,19 @@
|
||||||
|
require("module-alias/register")
|
||||||
|
|
||||||
|
import { Discord } from "./src/modules/eu/src/index"
|
||||||
|
import config from "./src/utils/config"
|
||||||
|
|
||||||
|
let Sharder = new Discord.ShardingManager('./build/index.js',
|
||||||
|
{
|
||||||
|
// @ts-ignore
|
||||||
|
token: config.tokens.discord,
|
||||||
|
respawn: true,
|
||||||
|
totalShards: "auto"
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
Sharder.on("shardCreate", async (shard) => {
|
||||||
|
console.log(`Launched Shard #${shard.id}`)
|
||||||
|
})
|
||||||
|
|
||||||
|
Sharder.spawn()
|
Loading…
Reference in New Issue