Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 2201560

Browse files
committed
fix: handle no admin channel
1 parent 47bf8cb commit 2201560

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/events/onMessage.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ export const onMessage = async (bot: ExtendedClient, message: Message) => {
2020
const adminChannel = bot.channels.cache.get(
2121
process.env.ADMIN_CHANNEL!,
2222
) as TextChannel;
23-
await adminChannel.send({
24-
embeds: [linkMessage],
25-
});
23+
if (adminChannel) {
24+
await adminChannel.send({
25+
embeds: [linkMessage],
26+
});
27+
}
2628
return; // Return as message is deleted
2729
}
2830

0 commit comments

Comments
 (0)