From 2ddb8f98b39dcf88da7a6a7746f643bf88875b87 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Sat, 16 Apr 2022 12:38:20 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20intents=20now=20in=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/example.discord.ts | 9 +++++++++ src/index.ts | 10 +++------- 2 files changed, 12 insertions(+), 7 deletions(-) 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();