mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
[#2] remove loading state from ocr translate
- discords media proxy causes this to occasionally RC
This commit is contained in:
parent
858a810e86
commit
7b88b7527a
1 changed files with 9 additions and 6 deletions
|
@ -4,11 +4,12 @@ const { TRANSLATE_DISPLAY_MAPPINGS, TRANSLATE_LANGUAGES, PERMISSION_GROUPS } = r
|
||||||
const { getMessageAttachment, validateAttachment } = require('#utils/attachment');
|
const { getMessageAttachment, validateAttachment } = require('#utils/attachment');
|
||||||
const { createEmbed } = require('#utils/embed');
|
const { createEmbed } = require('#utils/embed');
|
||||||
const { acknowledge } = require('#utils/interactions');
|
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 { editOrReply } = require('#utils/message');
|
||||||
const { STATICS, STATIC_ACTIONS } = require('#utils/statics');
|
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');
|
const { Components } = require('detritus-client/lib/utils');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -22,6 +23,12 @@ module.exports = {
|
||||||
integrationTypes: [
|
integrationTypes: [
|
||||||
ApplicationIntegrationTypes.USER_INSTALL
|
ApplicationIntegrationTypes.USER_INSTALL
|
||||||
],
|
],
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {Context} context
|
||||||
|
* @param {Argument} args
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
run: async (context, args) => {
|
run: async (context, args) => {
|
||||||
try{
|
try{
|
||||||
await acknowledge(context, false, [...PERMISSION_GROUPS.baseline_slash]);
|
await acknowledge(context, false, [...PERMISSION_GROUPS.baseline_slash]);
|
||||||
|
@ -44,10 +51,6 @@ module.exports = {
|
||||||
timeout: 100000,
|
timeout: 100000,
|
||||||
run: async (ctx) => {
|
run: async (ctx) => {
|
||||||
if (ctx.userId !== context.userId) return await ctx.respond(InteractionCallbackTypes.DEFERRED_UPDATE_MESSAGE);
|
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")
|
let translate = await googleTranslate(context, ocr.response.body.text, "en", "auto")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue