generated from lucxjo/template
Replaced ENV name
Signed-off-by: Louis Hollingworth <louis@hollingworth.ch>
This commit is contained in:
parent
b62ab78325
commit
c3f77419b1
3 changed files with 282 additions and 74 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue