-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.py
103 lines (94 loc) · 3.43 KB
/
bot.py
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
"use strict";
const Discord = require('discord.js');
const client = new Discord.Client();
const http = require('http')
const server = http.createServer((a,b)=>b.end('ok'))
server.listen(2900,_=>_)
let defund = `no more weebs
burn the weebs
waw is evil
down with big kristen
nazi mod
down with defund
weeeeeeeb
overthrow william austin wang`.split("\n")
let kmh = `malware man
kevin michael higgs
higgy baby
higgles
nazi mod`.split("\n")
function emojify(m){
return m.split("").map(x=>~"abcdefghijklmnopqrstuvwxyz".indexOf(x)?`:regional_indicator_${x}:`:x).join(' ');
}
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
let actf = client.guilds.resolve("686027739966341154");
let roles = actf.channels.resolve("686028786508103737");
roles.messages.fetch("686029687469637653",true);
});
client.on('message', msg => {
const sender = msg.guild?msg.guild.member(msg.author):null;
if (msg.content == "!ping" && msg.channel.id=="686030136406966311") {
msg.channel.send("pong");
}
if (/never_gonna_let_you_down/i.test(msg.content.replace(/[^a-zA-Z0-9{_\-.}]/g,''))) {
msg.delete().then(m=>console.log(`deleted message (legit flag)`)).catch(console.error);
if (sender) {
sender.ban('legit flag sharing').then(m=>console.log(`banned ${sender.user.tag}`)).catch(_=>_);
}
}
if (/actf{.+}/i.test(msg.content.replace(/[^a-zA-Z0-9{_\-.}]/g,''))) {
msg.delete().then(m=>console.log(`deleted message (flag)`)).catch(console.error);
if (sender) {
sender.kick('flag sharing').then(m=>console.log(`kicked ${sender.user.tag}`)).catch(_=>_);
}
}
if (~msg.content.toLowerCase().indexOf('kmh') && msg.channel.id=="686030136406966311") {
msg.channel.send(emojify(kmh[~~(Math.random()*kmh.length)]));
}
if (~msg.content.toLowerCase().indexOf('defund') && msg.channel.id=="686030136406966311") {
msg.channel.send(emojify(defund[~~(Math.random()*defund.length)]));
}
});
client.on('messageUpdate', (oldMessage,newMessage) => {
const sender = newMessage.guild?newMessage.guild.member(newMessage.author):null;
if (/never_gonna_let_you_down/i.test(newMessage.content.replace(/[^a-zA-Z0-9{_\-.}]/g,''))) {
newMessage.delete().then(m=>console.log(`deleted message (legit flag)`)).catch(console.error);
if (sender) {
sender.ban('legit flag sharing').then(m=>console.log(`banned ${sender.user.tag}`)).catch(_=>_);
}
}
if (/actf{.+}/i.test(newMessage.content.replace(/[^a-zA-Z0-9{_\-.}]/g,''))) {
newMessage.delete().then(m=>console.log(`deleted message (flag)`)).catch(console.error);
if (sender) {
sender.kick('flag sharing').then(m=>console.log(`kicked ${sender.user.tag}`)).catch(_=>_);
}
}
});
client.on('messageReactionAdd', (reaction,user) => {
if (reaction.message.id=="686029687469637653") {
const guild = reaction.message.guild;
const sender = guild?guild.member(user):null;
const emoji = reaction.emoji;
if (emoji.name == '🔔') {
sender.roles.add("686030992657612806")
}
if (emoji.name == '🚩') {
sender.roles.add("686028267475697666")
}
}
});
client.on('messageReactionRemove', (reaction,user) => {
if (reaction.message.id=="686029687469637653") {
const guild = reaction.message.guild;
const sender = guild?guild.member(user):null;
const emoji = reaction.emoji;
if (emoji.name == '🔔') {
try { sender.roles.remove("686030992657612806") } catch (e) {}
}
if (emoji.name == '🚩') {
try { sender.roles.remove("686028267475697666") } catch (e) {}
}
}
});
client.login(process.env.TOKEN);