diff --git a/src/config/example.discord.ts b/src/config/example.discord.ts index 682ff99..7b22c28 100644 --- a/src/config/example.discord.ts +++ b/src/config/example.discord.ts @@ -1,5 +1,14 @@ +import { Intents } from "discord.js"; // discord.js + // Discord API token export const token = ""; // Discord API id export const clientId = ""; + +// Discord API intents +export const intents = [ + Intents.FLAGS.GUILDS, + Intents.FLAGS.GUILD_MESSAGES, + Intents.FLAGS.GUILD_MEMBERS, +]; diff --git a/src/index.ts b/src/index.ts index 0dc5361..30493c8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ // Dependencies import "tsconfig-paths/register"; // Allows using tsconfig.json paths during runtime -import { Client, Intents } from "discord.js"; // discord.js +import { Client } from "discord.js"; // discord.js import locale from "@locale"; import database from "@database"; @@ -10,15 +10,11 @@ import events from "@handlers/events"; import commands from "@handlers/commands"; // Configurations -import { token } from "@config/discord"; +import { token, intents } from "@config/discord"; async function main() { const client = new Client({ - intents: [ - Intents?.FLAGS?.GUILDS, - Intents?.FLAGS?.GUILD_MESSAGES, - Intents?.FLAGS?.GUILD_MEMBERS, - ], + intents, }); await locale();