Skip to content

Commit

Permalink
fix: remove failed update
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyvy-vi committed Jun 30, 2023
1 parent 61d1f68 commit bc5796c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 2 additions & 0 deletions packages/discord-bot/src/handlers/praise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export const praiseHandler: CommandHandler = async (
);

if (giverAccount && giverAccount.user) {
await collector.stop();

Check failure on line 100 in packages/discord-bot/src/handlers/praise.ts

View workflow job for this annotation

GitHub Actions / Build & Lint

Unexpected `await` of a non-Promise (non-"Thenable") value
await givePraise(
interaction,
guild,
Expand All @@ -108,6 +109,7 @@ export const praiseHandler: CommandHandler = async (
host,
responseUrl
);
return;
}

await i.update({
Expand Down
17 changes: 7 additions & 10 deletions packages/discord-bot/src/utils/givePraise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export const givePraise = async (
],
components: [],
});

praiseItems = await createPraise(
interaction,
giverAccount,
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit bc5796c

Please sign in to comment.