This repository has been archived by the owner on May 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Require the necessary discord.js classes | ||
import { Client, Collection, GatewayIntentBits } from "discord.js"; | ||
import "dotenv/config"; | ||
import eventHandler from "./handlers/events.js"; | ||
import commandHandler from "./handlers/commands.js"; | ||
import interactionsHandler from "./handlers/interactions.js"; | ||
import { REST, Routes } from "discord.js"; | ||
const rest = new REST({ version: "10" }).setToken(process.env.TOKEN); | ||
|
||
const client: any = new Client({ intents: [GatewayIntentBits.Guilds] }); | ||
client.commands = new Collection(); | ||
client.interactions = new Collection(); | ||
client.guildsVoice = []; | ||
|
||
// Handlers | ||
eventHandler(client); | ||
commandHandler(client); | ||
interactionsHandler(client); | ||
|
||
client.login(process.env.TOKEN); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
// Require the necessary discord.js classes | ||
import { Client, Collection, GatewayIntentBits } from "discord.js"; | ||
import { ShardingManager } from "discord.js"; | ||
import "dotenv/config"; | ||
import eventHandler from "./handlers/events.js"; | ||
import commandHandler from "./handlers/commands.js"; | ||
import interactionsHandler from "./handlers/interactions.js"; | ||
import { REST, Routes } from "discord.js"; | ||
const rest = new REST({ version: "10" }).setToken(process.env.TOKEN); | ||
const manager = new ShardingManager("./dist/bot.js", { | ||
token: process.env.TOKEN, | ||
}); | ||
|
||
const client: any = new Client({ intents: [GatewayIntentBits.Guilds] }); | ||
client.commands = new Collection(); | ||
client.interactions = new Collection(); | ||
client.guildsVoice = []; | ||
|
||
// Handlers | ||
eventHandler(client); | ||
commandHandler(client); | ||
interactionsHandler(client); | ||
|
||
client.login(process.env.TOKEN); | ||
manager.on("shardCreate", (shard) => console.log(`Launched shard ${shard.id}`)); | ||
manager.spawn(); |