jellyfin-discord-bot/server/events/handleReactionAdd.ts

21 lines
708 B
TypeScript
Raw Normal View History

2023-06-25 01:57:40 +02:00
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
}