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

Commit

Permalink
fix: handle no admin channel
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-mba committed Sep 26, 2024
1 parent 47bf8cb commit 2201560
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/events/onMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export const onMessage = async (bot: ExtendedClient, message: Message) => {
const adminChannel = bot.channels.cache.get(
process.env.ADMIN_CHANNEL!,
) as TextChannel;
await adminChannel.send({
embeds: [linkMessage],
});
if (adminChannel) {
await adminChannel.send({
embeds: [linkMessage],
});
}
return; // Return as message is deleted
}

Expand Down

0 comments on commit 2201560

Please sign in to comment.