1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Remove reaction-related events

This commit is contained in:
toast-ts 2023-12-27 09:49:07 +11:00
parent 713df7bfcc
commit cfc1d5db19
3 changed files with 3 additions and 23 deletions

View File

@ -47,11 +47,10 @@ export default class TClient extends Discord.Client {
intents: [ intents: [
Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers, Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers,
Discord.GatewayIntentBits.GuildModeration, Discord.GatewayIntentBits.GuildInvites, Discord.GatewayIntentBits.GuildModeration, Discord.GatewayIntentBits.GuildInvites,
Discord.GatewayIntentBits.GuildMessageReactions, Discord.GatewayIntentBits.GuildPresences, Discord.GatewayIntentBits.GuildPresences, Discord.GatewayIntentBits.MessageContent,
Discord.GatewayIntentBits.MessageContent, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.GuildMessages, Discord.GatewayIntentBits.DirectMessages
Discord.GatewayIntentBits.DirectMessages
], partials: [ ], partials: [
Discord.Partials.Channel, Discord.Partials.Reaction, Discord.Partials.Message Discord.Partials.Channel, Discord.Partials.Message
], allowedMentions: {users:[], roles:[]} ], allowedMentions: {users:[], roles:[]}
}) })
this.config = ConfigHelper.loadConfig() as Config; this.config = ConfigHelper.loadConfig() as Config;

View File

@ -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<Discord.ButtonBuilder>().addComponents(new Discord.ButtonBuilder().setStyle(5).setURL(`${reaction.message.url}`).setLabel('Jump to message'))]});
}
}

View File

@ -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}>`)]})
}
}