-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.js
39 lines (30 loc) · 880 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
require("dotenv").config();
const Discord = require("discord.js");
const client = new Discord.Client({
partials: ["MESSAGE"],
});
const BOT_PREFIX = "!";
const COMMAND_MOD_ME = "modme";
const MODERATOR_ID = "805066549748432906";
client.on("ready", () => {
console.log(`Bot ready to Rock!!`);
});
client.on("messageDelete", (msg) => {
msg.channel.send("Stop deleting messaging! Not Cool");
});
client.on("message", (msg) => {
if (msg.content.toLowerCase().includes("aidan")) {
msg.react("💖");
}
if (msg.content === "ping") {
msg.channel.send("Pong!");
}
if (msg.content === `${BOT_PREFIX}${COMMAND_MOD_ME}`) {
modUser(msg.member);
}
});
const modUser = (member) => {
member.roles.add(MODERATOR_ID);
console.log(`Added Moderator Role to ${member.displayName}!`);
};
client.login(process.env.BOT_TOKEN);