-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
102 lines (87 loc) · 3.67 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
const Discord = require('discord.js');
const client = new Discord.Client();
const filterwebhook = new Discord.WebhookClient('746106311690682479', 'AihY-SOWd8-3Fjnt1Sj7_Ao01Djb5brGzYTW16mMeKZd-U435u6OEU4Eys-8USuZyjDa')
const badwords = ['faggot', 'nigga', 'nigger']
const prefix = '-';
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('Bot is online!');
client.user.setActivity("iGottic's Youtube Channel. -help for commands.", { type: "WATCHING"})
});
client.on('message', message => {
if(message.channel.type == "text" && message.channel.name.toLowerCase() == "🌐╎eng-chat") {
if (message.content.includes("https://")) {
const epic2embed = new Discord.MessageEmbed()
epic2embed.setTitle("Filter Alert: Link.")
epic2embed.addField('User who said the word:', `${message.author}`)
epic2embed.addField('Message:', `${message.content}`)
epic2embed.setColor("RANDOM")
message.reply("No links.")
filterwebhook.send(epic2embed)
message.delete()
}
}
})
client.on('message', message => {
if(message.channel.type == "text" && message.channel.name.toLowerCase() == "🌐╎eng-chat") {
if (message.content.includes("http://")) {
const epic2embed = new Discord.MessageEmbed()
epic2embed.setTitle("Filter Alert: Link.")
epic2embed.addField('User who said the word:', `${message.author}`)
epic2embed.addField('Message:', `${message.content}`)
epic2embed.setColor("RANDOM")
message.reply("No links.")
filterwebhook.send(epic2embed)
message.delete()
}
}
})
client.on('message', message => {
if(message.channel.type == "text" && message.channel.name.toLowerCase() == "🌐╎other-chat") {
if (message.content.includes("http://")) {
const epic2embed = new Discord.MessageEmbed()
epic2embed.setTitle("Filter Alert: Link.")
epic2embed.addField('User who said the word:', `${message.author}`)
epic2embed.addField('Message:', `${message.content}`)
epic2embed.setColor("RANDOM")
message.reply("No links.")
filterwebhook.send(epic2embed)
message.delete()
}
}
})
client.on('message', message => {
for (var i = 0; i < badwords.length; i++) {
if (message.content.includes(badwords[i])) {
const epicembed = new Discord.MessageEmbed()
epicembed.setTitle("Filter Alert.")
epicembed.addField('User who said the word:', `${message.author}`)
epicembed.addField('Message:', `${message.content}`)
epicembed.setColor("RANDOM")
message.reply("Please do not say that!")
filterwebhook.send(epicembed)
message.delete()
}
}
})
client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if(command === 'help'){
client.commands.get('help').execute(message, client, args);
}
if(command === 'apply'){
client.commands.get('application').execute(message, client, args);
}
if(command === 'credits'){
client.commands.get('credit').execute(message, client, args)
}
})
client.login(process.env.token);