-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
83 lines (74 loc) · 2.29 KB
/
index.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
77
78
79
80
81
82
83
require('dotenv').config();
const { Client, Events, GatewayIntentBits, ActivityType } = require('discord.js');
const consola = require('consola');
const bot = new Client({
allowedMentions: { parse: ['users', 'roles'], repliedUser: true },
intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds, GatewayIntentBits.MessageContent],
});
bot.once(Events.ClientReady, () => {
consola.success(`${bot.user.username} is now online!`);
bot.user.setActivity('DarkViperAU', {
type: ActivityType.Watching,
});
});
bot.on(Events.GuildCreate, (guild) => {
consola.info(`New guild joined: "${guild.name}" (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
});
bot.on(Events.GuildDelete, (guild) => {
consola.info(`Bot removed from: "${guild.name}" (id: ${guild.id})`);
});
const names = [
'Micheal',
'Michael',
'De Santa',
'Townley',
'Michael De Santa',
'Micheal De Santa',
'Michael De Santo',
'Micheal De Santo',
'Micheal Townley',
'Michael Townley',
'Micheal Townly',
'Michael Townly',
'M',
'Mikey',
'Mikey De Santa',
'Mr De Santa',
'Mr. De Santa',
'Sugar Tits',
'Michele',
'Slick',
'MT',
'Mr De Santo',
'Mr. De Santo',
'Mr DS',
'Mr. DS',
'The Sneaky Dude',
];
const endings = [
'in witness protection',
'is still in witness protection',
'is in witness protection',
'was in witness protection',
'has witness protection',
];
function tellPersonTheyAreWrong(message) {
message.reply('Witness protection for what?! No one was convicted of anything!');
consola.info(`⭐ Bot was used.`);
consola.info(`Message sent in "${message.guild.name}" (${message.guild.memberCount}). In response to "${message.content}".`);
}
bot.on(Events.MessageCreate, (message) => {
if (message.author.bot) return;
for (const name in names) {
for (const ending in endings) {
if (
message.content.toLowerCase().includes(names[name].toLowerCase()) &&
message.content.toLowerCase().includes(endings[ending].toLowerCase())
)
return tellPersonTheyAreWrong(message);
}
}
});
process.on('uncaughtException', (err) => consola.error(err)).on('unhandledRejection', (err) => consola.error(err));
// —— Login the bot
bot.login(process.env.BOT_TOKEN);