From eae7a91b50a031973ff6bd2f49eaf0bf778f8a8d Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Mon, 5 Dec 2022 18:44:39 -0700 Subject: [PATCH] Don't crash with missing autorole message --- src/modules/autorole.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/autorole.ts b/src/modules/autorole.ts index dcbc4dc..724b376 100644 --- a/src/modules/autorole.ts +++ b/src/modules/autorole.ts @@ -11,7 +11,7 @@ export async function autoroleModule({ client }: Bot) { } for (const ar of autorole) { - const msg = await channel.messages.fetch(ar.msgID); + const msg = await channel.messages.fetch(ar.msgID).catch(() => null); if (!msg) { console.error(`Role message does not exist for ${ar.msgID}`); }