-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
67 lines (55 loc) · 1.63 KB
/
Copy pathmain.js
File metadata and controls
67 lines (55 loc) · 1.63 KB
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
const Discord = require("discord.js");
const config = require("./config.json");
const fs = require("fs");
const bot = new Discord.Client({ disableEveryone: true });
const search = require("yt-search");
const ownerID = "440076332739854336";
const active = new Map();
bot.commands = new Discord.Collection();
fs.readdir(`./commands/`, (err, files) => {
if (err) console.log(err);
let jsfile = files.filter((f) => f.split(".").pop() === "js");
if (jsfile.length <= 0) {
console.log("Je ne trouve pas la commande");
return;
}
jsfile.forEach((f, i) => {
let props = require(`./commands/${f}`);
bot.commands.set(props.help.name, props);
});
});
bot.on("ready", async () => {
console.log(" Bot est en ligne !");
bot.user.setActivity("Pornhub", `{ type: 'WATCHING' }`);
});
bot.on("message", async (message) => {
if (message.author.bot) return;
if (message.channel.type === "dm") return;
let prefix = process.env.PREFIX;
let messageArray = message.content.split(" ");
let command = messageArray[0];
let args = messageArray.slice(1);
let commandFile = bot.commands.get(command.slice(prefix.length));
if (commandFile) commandFile.run(bot, message, args);
let blacklisted = [
"batard",
"enculé",
"fuck",
"pute",
"bitch",
"connard",
"con",
];
let foundInText = false;
for (var i in blacklisted) {
if (message.content.toLowerCase().includes(blacklisted[i].toLowerCase()))
foundInText = true;
}
if (foundInText) {
message.delete();
message.channel
.send("Attention au warn !")
.then((msg) => msg.delete(10000));
}
});
bot.login(process.env.TOKEN);