diff --git a/commands/interaction/context/ocr.js b/commands/interaction/context/ocr.js index 0029a06..8d6c96c 100644 --- a/commands/interaction/context/ocr.js +++ b/commands/interaction/context/ocr.js @@ -4,11 +4,12 @@ const { TRANSLATE_DISPLAY_MAPPINGS, TRANSLATE_LANGUAGES, PERMISSION_GROUPS } = r const { getMessageAttachment, validateAttachment } = require('#utils/attachment'); const { createEmbed } = require('#utils/embed'); const { acknowledge } = require('#utils/interactions'); -const { codeblock, pill, icon } = require('#utils/markdown'); +const { codeblock, pill, icon, iconAsEmojiObject } = require('#utils/markdown'); const { editOrReply } = require('#utils/message'); const { STATICS, STATIC_ACTIONS } = require('#utils/statics'); +const { Context, Argument } = require('detritus-client/lib/command'); -const { ApplicationCommandTypes, MessageFlags, InteractionContextTypes, ApplicationIntegrationTypes } = require("detritus-client/lib/constants"); +const { ApplicationCommandTypes, MessageFlags, InteractionContextTypes, ApplicationIntegrationTypes, MessageComponentTypes, InteractionCallbackTypes } = require("detritus-client/lib/constants"); const { Components } = require('detritus-client/lib/utils'); module.exports = { @@ -22,6 +23,12 @@ module.exports = { integrationTypes: [ ApplicationIntegrationTypes.USER_INSTALL ], + /** + * + * @param {Context} context + * @param {Argument} args + * @returns + */ run: async (context, args) => { try{ await acknowledge(context, false, [...PERMISSION_GROUPS.baseline_slash]); @@ -44,10 +51,6 @@ module.exports = { timeout: 100000, run: async (ctx) => { if (ctx.userId !== context.userId) return await ctx.respond(InteractionCallbackTypes.DEFERRED_UPDATE_MESSAGE); - - await ctx.editOrRespond({ - embeds: [createEmbed("ai_custom", context, STATIC_ACTIONS.translate)] - }) let translate = await googleTranslate(context, ocr.response.body.text, "en", "auto")