feat/40-reroll-on-disinterest #54

Merged
kenobi merged 73 commits from feat/40-reroll-on-disinterest into master 2023-11-19 20:24:36 +01:00
Showing only changes of commit c351e27fdd - Show all commits

View File

@ -3,6 +3,7 @@ import { Message, MessageReaction, User } from "discord.js";
import { logger, newRequestId, noGuildId } from "../logger";
import { NONE_OF_THAT } from "../constants";
import { client } from "../..";
import { messageIsVoteMessage } from "../helper/messageIdentifiers";
export const name = 'messageReactionAdd'
@ -25,8 +26,11 @@ export async function execute(messageReaction: MessageReaction, user: User) {
logger.info(`emoji: ${messageReaction.emoji.toString()}`)
if (messageReaction.emoji.toString() === NONE_OF_THAT) {
logger.info(`Reaction is NONE_OF_THAT. Handling`, { requestId, guildId })
return client.VoteController.handleNoneOfThatVote(messageReaction, user, reactedUponMessage, requestId, guildId)
if (messageIsVoteMessage(reactedUponMessage)) {
logger.info(`Reaction is NONE_OF_THAT on a vote message. Handling`, { requestId, guildId })
return client.VoteController.handleNoneOfThatVote(messageReaction, user, reactedUponMessage, requestId, guildId)
}
}
return