diff --git a/src/events/onMessage.ts b/src/events/onMessage.ts index a87fc3e1..19591e60 100644 --- a/src/events/onMessage.ts +++ b/src/events/onMessage.ts @@ -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 }