-
Notifications
You must be signed in to change notification settings - Fork 1
/
modbot.js
47 lines (43 loc) · 1.9 KB
/
modbot.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
const discord = require("discord.js");
const mod_client = new discord.Client({
intents: [discord.GatewayIntentBits.Guilds, discord.GatewayIntentBits.GuildMembers, discord.GatewayIntentBits.GuildMessages, discord.GatewayIntentBits.MessageContent]
});
mod_client.once("ready", async (info) => {
console.log("Ready! as " + info.user.tag);
mod_client.user.setPresence({
activities: [
{
name: "for securities",
type: 3,
}
],
status: "online",
});
});
mod_client.on("messageCreate", async (message) => {
const blacklist = ["community manager", "nudes", "discord.com/invite", "discord.gg/", "free mint", "gas refund", "air-drop"];
const content = message.content.toLowerCase();
if (blacklist.some((b) => content.includes(b)) || (content.includes("airdrop") && content.length > 100)) {
await message.member.fetch();
//if unverified (and not self [todo: not bot?]), delete invite
if (!message.member.roles.cache.has("1100582916871958578") && message.member.id !== "1224934300244512789") {
await message.reply(`<@${message.member.id}> <a:siren:1105674561829228626> **Possible UNREGISTERED SECURITY (||scam/spam||) detected, message deleted** <a:siren:1105674561829228626>`);
const mod_channel = "1127793284195041372";//"1070194353768775761";
try {
await message.delete();
} catch (e) {
console.log(e);
await mod_client.channels.cache.get(mod_channel).send(`Missing delete perms in <#${message.channel.id}>?\n${message.url}`);
}
try {
//await mod_client.channels.fetch();
await mod_client.channels.cache.get(mod_channel).send(`__Log: Deleted Likely Spam__\nUser: <@${message.member.id}>\nChannel: <#${message.channel.id}>\nContent: ${ message.length > 1000 ? message.slice(0, 1000) + "..." : message }`);
} catch (e) {
console.log(e);
}
}
}
});
module.exports = {
mod_client,
};