From 1f372b0aacd94d6eb5cfbe2e72f61dfdf77c1a31 Mon Sep 17 00:00:00 2001 From: kenobi Date: Sat, 25 Nov 2023 19:50:54 +0100 Subject: [PATCH] fix naming for reaction --- server/helper/role.controller.ts | 2 +- server/structures/client.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/helper/role.controller.ts b/server/helper/role.controller.ts index 462d927..402103d 100644 --- a/server/helper/role.controller.ts +++ b/server/helper/role.controller.ts @@ -41,7 +41,7 @@ export default class RoleController { .catch(error => { logger.error(`Could not find announcement_role with id ${config.bot.announcement_role}. Error: ${error}`, { requestId, guildId: guild.id }) }) } - public async assignAnnouncementRolesFromReactions(guild: Guild, reaction: MessageReaction, requestId: string) { + public async assignAnnouncementRolesFromReaction(guild: Guild, reaction: MessageReaction, requestId: string) { const guildId = guild.id logger.info("Managing roles", { guildId, requestId }) diff --git a/server/structures/client.ts b/server/structures/client.ts index 186b41d..8f0c771 100644 --- a/server/structures/client.ts +++ b/server/structures/client.ts @@ -173,10 +173,10 @@ export class ExtendedClient extends Client { } //logger.debug(`Message: ${JSON.stringify(message, null, 2)}`, { guildId: guild.id, requestId }) - const reactions = message.reactions.resolve("🎫") + const ticketReaction = message.reactions.resolve("🎫") //logger.debug(`reactions: ${JSON.stringify(reactions, null, 2)}`, { guildId: guild.id, requestId }) - if (reactions) { - this.roleController.assignAnnouncementRolesFromReactions(message.guild, reactions, requestId) + if (ticketReaction) { + this.roleController.assignAnnouncementRolesFromReaction(message.guild, ticketReaction, requestId) } else { logger.error("Did not get reactions! Aborting!", { guildId: guild.id, requestId }) }