Skip to content

Commit eae7a91

Browse files
committed
Don't crash with missing autorole message
1 parent 02b8dc2 commit eae7a91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/modules/autorole.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export async function autoroleModule({ client }: Bot) {
1111
}
1212

1313
for (const ar of autorole) {
14-
const msg = await channel.messages.fetch(ar.msgID);
14+
const msg = await channel.messages.fetch(ar.msgID).catch(() => null);
1515
if (!msg) {
1616
console.error(`Role message does not exist for ${ar.msgID}`);
1717
}

0 commit comments

Comments
 (0)