From 6e681e5667a475600bf7084fc2381c447fca1176 Mon Sep 17 00:00:00 2001 From: hawkeye7662 <82515230+hawkeye7662@users.noreply.github.com> Date: Fri, 18 Mar 2022 23:53:59 +0530 Subject: [PATCH] Catches too many reactions error Catches Maximum number of reactions reached (20) error by checking for error code 30010 --- .../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 a2641bfe5..3c0a9fa52 100644 --- a/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts +++ b/backend/src/plugins/ReactionRoles/util/applyReactionRoleReactionsToMessage.ts @@ -87,6 +87,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; } }