From c384cb8022112a8957829702266258ab849a571e Mon Sep 17 00:00:00 2001 From: derpystuff <3515180-derpystuff@users.noreply.gitlab.com> Date: Wed, 22 Jun 2022 22:45:01 +0200 Subject: [PATCH] fix no image message on context ocr --- commands/interaction/context/ocr.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/interaction/context/ocr.js b/commands/interaction/context/ocr.js index 050a2de..60e3a05 100644 --- a/commands/interaction/context/ocr.js +++ b/commands/interaction/context/ocr.js @@ -18,10 +18,10 @@ module.exports = { const { message } = args; let attachment = getMessageAttachment(message) - if(validateAttachment(attachment)){ + if(attachment && validateAttachment(attachment)){ attachment = attachment.url } else { - attachment = undefined + delete attachment; } if(!attachment) return context.editOrRespond({ embeds: [createEmbed("warning", context, "No images found.")], flags: MessageFlags.EPHEMERAL })