-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
76 lines (63 loc) · 1.65 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const Discord = require("discord.js");
const bot = new Discord.Client();
const auth = require("auth.js");
var lennyTriggers = ["ass",
"tits",
"boob",
"boobs",
"butt",
"nipples",
"lenny"];
const prefix = "!";
const buzzfeed = "https://www.buzzfeed.com"
bot.on("ready", () => {
console.log("I am ready!");
});
bot.on("message", (message) => {
if (!message.content.startsWith(prefix))
{
var str = message.content.toLowerCase();
if (lennyTriggers.some(function(v) { return str.indexOf(v) >= 0; }))
{
message.channel.send("( ͡° ͜ʖ ͡°)");
}
if (str === "shrug")
{
message.channel.send("¯\\_(ツ)_/¯");
}
if (str.includes(buzzfeed))
{
message.channel.send("No Buzzfeed shit.");
message.delete(1);
}
}
const args = message.content.slice(prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
if (command == ("9/11"))
{
message.channel.send("https://www.youtube.com/watch?v=QX1SojKfgNI");
}
});
bot.on('voiceStateUpdate', (oldMember, newMember) => {
let newUserChannel = newMember.voiceChannel;
let oldUserChannel = oldMember.voiceChannel;
if (oldUserChannel === undefined && newUserChannel !== undefined)
{
// User Joins a voice channel
if (newMember.id == 109400160093601792)
{
console.log("The maker joined a voice channel!");
newUserChannel.join()
console.log("I'll join too!");
}
} else if (newUserChannel === undefined){
// User leaves a voice channel
if (oldMember.id == 109400160093601792)
{
console.log("The maker left a voice channel!");
oldUserChannel.leave();
console.log("I'll leave too!");
}
}
})
bot.login(auth.token);