1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-29 16:30:59 -04:00
Daggerbot-TS/src/events/messageReactionAdd.ts

12 lines
1.2 KiB
TypeScript

import Discord from 'discord.js';
import TClient from '../client.js';
export default {
run(client:TClient, reaction:Discord.MessageReaction, user:Discord.User){
if (!client.config.botSwitches.logs) return;
if (reaction.message.guildId != client.config.mainServer.id || reaction.message.partial) return;
const ReactedFirst = reaction.users.cache.first();
if (ReactedFirst.id != user.id) return;
if (reaction.emoji.name === '🖕') return (client.channels.cache.get(client.config.mainServer.channels.logs) as Discord.TextChannel).send({embeds:[new client.embed().setColor(client.config.embedColorYellow).setTimestamp().setAuthor({name: `Author: ${ReactedFirst.username} (${ReactedFirst.id})`, iconURL: `${ReactedFirst.displayAvatarURL()}`}).setTitle('Message reaction').setDescription(`<@${ReactedFirst.id}>\nAdded a reaction to the message.\n**Emoji**\n${reaction.emoji.name}\n**Channel**\n<#${reaction.message.channelId}>`).setFooter({text: 'Possibly this member, bot fetches who reacted first.'})], components: [new Discord.ActionRowBuilder<Discord.ButtonBuilder>().addComponents(new Discord.ButtonBuilder().setStyle(5).setURL(`${reaction.message.url}`).setLabel('Jump to message'))]});
}
}