Skip to content

Commit

Permalink
Don't crash with missing autorole message
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Jun 22, 2024
1 parent 02b8dc2 commit eae7a91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/autorole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
Expand Down

0 comments on commit eae7a91

Please sign in to comment.