-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
34 lines (30 loc) · 1.18 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
const {Client, Intents} = require("discord.js");
const bot = new Client({intents: [Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILD_MESSAGE_REACTIONS]});
const config = require("./config.json");
bot.login(config.token)
bot.on("ready", () => {
console.log(bot.user.tag)
bot.user.setActivity(require("./package.json").version)
})
bot.on("messageReactionAdd", (reaction, user) => {
if (user.bot) return;
if (reaction.count == 1) {
const embed = {
"title": "Member has added a reaction",
"description": `${user} added the ${reaction.emoji.name} reaction to this [message](${reaction.message.url}) in ${reaction.message.channel}.`,
"color": 9442302,
"timestamp": Date.now(),
"footer": {
"text": `ID: ${user.id}`
},
"thumbnail": {
"url": reaction.emoji.url
},
"author": {
"name": user.tag,
"icon_url": user.avatarURL()
}
};
bot.channels.cache.get(config.channelid).send({ embeds: [embed] })
}
})