From d51461ee3af2a1229578817c2169bdfd2f4ec243 Mon Sep 17 00:00:00 2001 From: hawkeye7662 <82515230+hawkeye7662@users.noreply.github.com> Date: Fri, 29 Dec 2023 18:02:48 +0530 Subject: [PATCH] Catch Too Many Reactions error (#326) Catches Maximum number of reactions reached (20) error by checking for error code 30010 Co-authored-by: Almeida --- .../util/applyReactionRoleReactionsToMessage.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts b/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts index 94de86312..5d1b3a37f 100644 --- a/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts +++ b/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts @@ -86,6 +86,12 @@ export async function applyReactionRoleReactionsToMessage( body: `Error ${e.code} while applying reaction role reactions to ${channelId}/${messageId}: ${e.message}`, }); break; + } else if (e.code === 30010) { + errors.push(`Maximum number of reactions reached (20)`); + logs.logBotAlert({ + body: `Error ${e.code} while applying reaction role reactions to ${channelId}/${messageId}: ${e.message}`, + }); + break; } }