perform vote message check in reaction handler
This commit is contained in:
parent
6d3bea169e
commit
c351e27fdd
@ -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 })
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user