From bc5796c036ca486ab56fd426b57902904bde7421 Mon Sep 17 00:00:00 2001 From: Vy Date: Fri, 30 Jun 2023 18:50:19 +0530 Subject: [PATCH] fix: remove failed update --- packages/discord-bot/src/handlers/praise.ts | 2 ++ packages/discord-bot/src/utils/givePraise.ts | 17 +++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/discord-bot/src/handlers/praise.ts b/packages/discord-bot/src/handlers/praise.ts index 6bce20682..faff9d525 100644 --- a/packages/discord-bot/src/handlers/praise.ts +++ b/packages/discord-bot/src/handlers/praise.ts @@ -97,6 +97,7 @@ export const praiseHandler: CommandHandler = async ( ); if (giverAccount && giverAccount.user) { + await collector.stop(); await givePraise( interaction, guild, @@ -108,6 +109,7 @@ export const praiseHandler: CommandHandler = async ( host, responseUrl ); + return; } await i.update({ diff --git a/packages/discord-bot/src/utils/givePraise.ts b/packages/discord-bot/src/utils/givePraise.ts index 00be2f82a..a7c0b5203 100644 --- a/packages/discord-bot/src/utils/givePraise.ts +++ b/packages/discord-bot/src/utils/givePraise.ts @@ -82,6 +82,7 @@ export const givePraise = async ( ], components: [], }); + praiseItems = await createPraise( interaction, giverAccount, @@ -124,16 +125,12 @@ export const givePraise = async ( const warningMsgParts: string[] = []; if (parsedReceivers.undefinedReceivers) { - const warning = await renderMessage( - 'PRAISE_UNDEFINED_RECEIVERS_WARNING', - host, - { - receivers: parsedReceivers.undefinedReceivers.map((id) => - id.replace(/[<>]/, '') - ), - user: member.user, - } - ); + const warning = await renderMessage('', host, { + receivers: parsedReceivers.undefinedReceivers.map((id) => + id.replace(/[<>]/, '') + ), + user: member.user, + }); warningMsgParts.push(warning); }