-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
42 lines (36 loc) · 954 Bytes
/
bot.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
// Require the necessary discord.js classes
const { Client, GatewayIntentBits, MessagePayload } = require("discord.js");
require("dotenv").config();
// Create a new client instance
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
// When the client is ready, run this code (only once)
client.once("ready", () => {
console.log("Ready!");
});
const MASTERLIST = [
"hein",
"hein ?",
"hein?",
"un",
];
client.on("messageCreate", message => {
for (const word of MASTERLIST) {
if (message.content.toLowerCase().endsWith(word)) {
message.reply(MessagePayload.create(message, {
reply : { messageReference : message },
files : ["videos/video.mp4"],
content : "deux :v:" },
));
console.log(`trolled ${message.author.tag}`);
return;
}
}
});
// Login to Discord with your client's token
client.login(process.env.DISCORD_TOKEN);