major cleanup

This commit is contained in:
derpystuff 2023-11-04 17:29:06 +01:00
parent ddd918470e
commit a8cf49e31e
60 changed files with 537 additions and 619 deletions

View file

@ -19,16 +19,16 @@ module.exports = {
run: async (context) => {
context.triggerTyping();
let image = await getRecentImage(context, 50)
if (!image) return editOrReply(context, { embeds: [createEmbed("warning", context, "No images found.")] })
if (!image) return editOrReply(context, createEmbed("warning", context, "No images found."))
let ocr;
try{
ocr = await googleVisionOcr(context, image)
}catch(e){
return editOrReply(context, { embeds: [createEmbed("error", context, "Unable to retrieve Google Vision API response.")] })
return editOrReply(context, createEmbed("error", context, "Unable to retrieve Google Vision API response."))
}
if(ocr.response.body.status == 1) return editOrReply(context, { embeds: [createEmbed("warning", context, ocr.response.body.text)] })
if(ocr.response.body.status == 1) return editOrReply(context, createEmbed("warning", context, ocr.response.body.text))
return editOrReply(context, createEmbed("default", context, {
thumbnail: {