Replaced ENV name

Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
Louis Hollingworth 2023-05-07 20:24:30 +01:00
parent b62ab78325
commit c3f77419b1
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
3 changed files with 282 additions and 74 deletions

View file

@ -1,8 +1,11 @@
import { dirname, importx } from "@discordx/importer";
import type { Interaction, Message } from "discord.js";
import { IntentsBitField } from "discord.js";
import * as dotenv from "dotenv";
import { Client } from "discordx";
dotenv.config();
export const bot = new Client({
// To use only guild command
// botGuilds: [(client) => client.guilds.cache.map((guild) => guild.id)],
@ -60,12 +63,12 @@ async function run() {
await importx(`${dirname(import.meta.url)}/{events,commands}/**/*.{ts,js}`);
// Let's start the bot
if (!process.env.BOT_TOKEN) {
throw Error("Could not find BOT_TOKEN in your environment");
if (!process.env.DISCORD_TOKEN) {
throw Error("Could not find DISCORD_TOKEN in your environment");
}
// Log in with your bot token
await bot.login(process.env.BOT_TOKEN);
await bot.login(process.env.DISCORD_TOKEN);
}
run();