diff --git a/apps/bot-discord/src/events/messageCreate.js b/apps/bot-discord/src/events/messageCreate.js index d0fa5ea..fa4713c 100644 --- a/apps/bot-discord/src/events/messageCreate.js +++ b/apps/bot-discord/src/events/messageCreate.js @@ -14,7 +14,7 @@ export default { } const hasImmunity = msg.member.roles.cache.some(role => role.id === config.discord.ignoreRole); if (config.discord.ignoreChannels.includes(msg.channelId)) return; - if (msg.attachments.first() && msg.attachments.first().contentType.startsWith('image') && !hasImmunity) { + if (msg.attachments.first()?.contentType?.startsWith('image') && !hasImmunity) { helper.scanImage(msg.attachments.first().url, `${msg.channelId}/${msg.id}`); }