-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
43 lines (36 loc) · 819 Bytes
/
bot.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
require("dotenv").config();
const { Client, Intents } = require("discord.js");
const { AudioBot } = require("./src/audioBot");
const {
shouldReadMessage,
getSanitisedCommand,
handleCommand,
} = require("./src/functions");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_VOICE_STATES,
],
});
const queue = new Map();
const PhilBot = new AudioBot(
"command",
null,
queue,
"voiceChannel",
"connection",
false
);
client.on("ready", () => {
console.log("Phil Bot Ready");
});
client.on("message", (msg) => {
const { content } = msg;
if (shouldReadMessage(content)) {
const command = getSanitisedCommand(content);
handleCommand(PhilBot, msg, command);
}
return;
});
client.login(process.env.BOT_TOKEN);