jellyfin-discord-bot/server/events/handleReactionAdd.ts
kenobi b8a32aab40
All checks were successful
Compile the repository / compile (pull_request) Successful in 1m14s
Run unit tests / test (pull_request) Successful in 1m38s
stub for reactionhandling
2023-06-25 01:57:40 +02:00

21 lines
708 B
TypeScript

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
}