From c5101717e5d27df8b82cd8955902bd11c5560a67 Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Wed, 27 Dec 2023 09:49:07 +1100 Subject: [PATCH] Remove reaction-related events --- src/client.ts | 7 +++---- src/events/messageReactionAdd.ts | 11 ----------- src/events/messageReactionRemove.ts | 8 -------- 3 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 src/events/messageReactionAdd.ts delete mode 100644 src/events/messageReactionRemove.ts diff --git a/src/client.ts b/src/client.ts index 52e1137..a65b9a4 100644 --- a/src/client.ts +++ b/src/client.ts @@ -47,11 +47,10 @@ export default class TClient extends Discord.Client { intents: [ Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers, Discord.GatewayIntentBits.GuildModeration, Discord.GatewayIntentBits.GuildInvites, - Discord.GatewayIntentBits.GuildMessageReactions, Discord.GatewayIntentBits.GuildPresences, - Discord.GatewayIntentBits.MessageContent, Discord.GatewayIntentBits.GuildMessages, - Discord.GatewayIntentBits.DirectMessages + Discord.GatewayIntentBits.GuildPresences, Discord.GatewayIntentBits.MessageContent, + Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.DirectMessages ], partials: [ - Discord.Partials.Channel, Discord.Partials.Reaction, Discord.Partials.Message + Discord.Partials.Channel, Discord.Partials.Message ], allowedMentions: {users:[], roles:[]} }) this.config = ConfigHelper.loadConfig() as Config; diff --git a/src/events/messageReactionAdd.ts b/src/events/messageReactionAdd.ts deleted file mode 100644 index e47146d..0000000 --- a/src/events/messageReactionAdd.ts +++ /dev/null @@ -1,11 +0,0 @@ -import Discord from 'discord.js'; -import TClient from '../client.js'; -export default class MessageReactionAdd { - static run(client:TClient, reaction:Discord.MessageReaction, user:Discord.User){ - if (!client.config.botSwitches.logs) return; - if (reaction.message.guildId != client.config.dcServer.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.dcServer.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().addComponents(new Discord.ButtonBuilder().setStyle(5).setURL(`${reaction.message.url}`).setLabel('Jump to message'))]}); - } -} diff --git a/src/events/messageReactionRemove.ts b/src/events/messageReactionRemove.ts deleted file mode 100644 index c55f59b..0000000 --- a/src/events/messageReactionRemove.ts +++ /dev/null @@ -1,8 +0,0 @@ -import Discord from 'discord.js'; -import TClient from '../client.js'; -export default class MessageReactionRemove { - static run(client:TClient, reaction:Discord.MessageReaction, user:Discord.User){ - if (!client.config.botSwitches.logs || reaction.message.guildId != client.config.dcServer.id || reaction.message.partial) return; - if (reaction.emoji.name === '🖕') return (client.channels.cache.get(client.config.dcServer.channels.logs) as Discord.TextChannel).send({embeds:[new client.embed().setColor(client.config.embedColorRed).setTimestamp().setAuthor({name: `Author: ${user.username} (${user.id})`, iconURL: user.displayAvatarURL()}).setTitle('Message reaction').setDescription(`<@${user.id}>\nRemoved a reaction from the message.\n**Emoji**\n${reaction.emoji.name}\n**Channel**\n<#${reaction.message.channelId}>`)]}) - } -}