-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
22 lines (18 loc) · 912 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Require the necessary discord.js classes
const { Client, Intents, Message } = require('discord.js');
// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_MESSAGES] });
// When the client is ready, run this code (only once)
client.on('ready', () => {
console.log(`[LOG] Logged in as ${client.user.tag}!`);
client.channels.cache.find(channel => channel.id === 'SOME_CHANNEL_ID').send(`I'm ready!`);
});
client.on('messageReactionAdd', (reaction, user) => {
if(user.bot) return;
if(reaction.emoji.name == "⛔" && reaction.count == 5){
console.log(`Reaction!`);
reaction.message.delete()
reaction.message.channel.send(`${reaction.message.author}'s message has been deleted lol`)
}});
// Login to Discord with your client's token
client.login(`TOKEN`);