feat/40-reroll-on-disinterest #54
20
server/events/handleReactionAdd.ts
Normal file
20
server/events/handleReactionAdd.ts
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
import { Message, MessageReaction, User } from "discord.js";
|
||||
import { messageIsVoteMessage } from "../helper/messageIdentifiers";
|
||||
import { logger, newRequestId, noGuildId } from "../logger";
|
||||
|
||||
|
||||
export const name = 'messageReactionAdd'
|
||||
|
||||
export async function execute(messageReaction: MessageReaction, user: User) {
|
||||
const requestId = newRequestId
|
||||
const guildId = messageReaction.message.inGuild() ? messageReaction.message.guildId : noGuildId
|
||||
|
||||
const reactedUponMessage: Message = messageReaction.message.partial ? await messageReaction.message.fetch() : messageReaction.message
|
||||
|
||||
if (messageIsVoteMessage(reactedUponMessage)) {
|
||||
logger.info(`Got reaction on message`, { requestId, guildId })
|
||||
}
|
||||
|
||||
return
|
||||
}
|
Loading…
Reference in New Issue
Block a user