mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-11 13:56:15 +00:00
fix(bots-discord): exception when Attachment#contentType is null
See: https://discord.js.org/docs/packages/discord.js/main/Attachment:Class#contentType
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user