-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
31 lines (27 loc) · 850 Bytes
/
Copy pathindex.js
File metadata and controls
31 lines (27 loc) · 850 Bytes
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
// bullybot
const {Client, Intents, Permissions} = require("discord.js")
const client=new Client({
intents:[
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES
]
});
const modulesPath = "./Modules/"
const commandsModule = require(modulesPath + "commands.js")
require("dotenv").config()
const prefix = "bullybot$"
client.on("messageCreate", (msg) => {
if (msg.author.bot){return}
const recognizedPrefix = msg.content.substring(0, prefix.length)
if (recognizedPrefix === prefix){
const messaged = msg.content.substring(prefix.length, msg.content.length)
const commandFetched = commandsModule[messaged.split(" ")[0]]
if (commandFetched){
commandFetched.functionToRun(msg)
}
}
})
client.on("ready", () => {
console.log("ready")
})
client.login(process.env.Token)