-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
46 lines (33 loc) · 1.81 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Load .env file
require("dotenv").config({ path: `.env.${process.env.NODE_ENV || 'development' }` });
// Load node native modules
const fs = require("fs");
const path = require("path");
// Load NPM modules
const Logger = require("@ptkdev/logger");
const { Client, GatewayIntentBits, Partials, Options } = require("discord.js");
// Global variables
global.__basedir = __dirname;
// Initialize logger
global.logger = new Logger();
// Load loaders
global.loaders = require("./app/libraries/loaders");
// Discord Client
global.client = new Client({
intents: [GatewayIntentBits.DirectMessageReactions, GatewayIntentBits.DirectMessageTyping, GatewayIntentBits.DirectMessages, GatewayIntentBits.GuildBans, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildModeration, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildScheduledEvents, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildWebhooks, GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent]
//intents: process.env.DISCORD_BOT_INTENTS.split(",").map((intent) => GatewayIntentBits[intent]),
//partials: process.env.DISCORD_BOT_PARTIALS.split(",").map((partial) => Partials[partial])
});
console.log(process.env.DISCORD_BOT_INTENTS.split(",").map((intent) => GatewayIntentBits[intent]))
// Load Commands
loaders.loadCommands();
// Load Components
loaders.loadComponents();
// Load Schedulers
loaders.loadSchedulers();
// Load Interaction Handler
require('./app/handlers/interaction')();
// Load Events
loaders.loadEvents();
// Run Discord Client
client.login(process.env.DISCORD_BOT_TOKEN);