-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.js
More file actions
38 lines (31 loc) · 1.13 KB
/
start.js
File metadata and controls
38 lines (31 loc) · 1.13 KB
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
require("dotenv").config()
const Discord = require("discord.js");
const { intentsList } = require("./scripts/data");
const client = new Discord.Client({
disableEveryone: true,
presence:{
status: "online",
activity: {
name: "@PenguinoJS help",
type: "WATCHING"
}
},
intents: intentsList,
partials: ['CHANNEL'],
// { partials: ['MESSAGE', 'CHANNEL', 'REACTION'] }
});
client.discord = Discord; // Attach discord functions into client
require("./scripts/values.js")(client); // Initialize prefix and variables
require("./load.js")(client); // Load in commands and events
require("./ChatGPT/gpt")(client);
require("./Slash/index.js")// Load SLash Command Bot
require("./Sequelize/init")(); // Initialize Sequelize Connection
// Events >> Ready Event >> require("./Express/express")(client); // Initialize Bot API
// process.on('unhandledRejection', err => { if (err) console.log(err) });
// Handle clean exit
process.on('SIGINT', async () => {
if (this.voice && this.voice.connections.length)
await this.voice.connections.map((c) => c.channel.leave());
process.exit()
});
client.login(process.env.TOKEN);