diff --git a/commands/interaction/context/ocr.js b/commands/interaction/context/ocr.js index c4e296d..d92e918 100644 --- a/commands/interaction/context/ocr.js +++ b/commands/interaction/context/ocr.js @@ -42,7 +42,7 @@ module.exports = { thumbnail: { url: attachment }, - description: codeblock("ansi", ["​" + ocr.response.body.text]), + description: codeblock("ansi", ["​" + ocr.response.body.text.substr(0,3900)]), footer: { iconUrl: STATICS.google, text: `Google Cloud Vision • ${context.application.name} • Took ${ocr.timings}s` diff --git a/commands/interaction/context/ocrtr.js b/commands/interaction/context/ocrtr.js index ec16043..f9b1453 100644 --- a/commands/interaction/context/ocrtr.js +++ b/commands/interaction/context/ocrtr.js @@ -46,7 +46,7 @@ module.exports = { let toFlag = TRANSLATE_LANGUAGE_MAPPINGS[translate.response.body.language.to] || '' return editOrReply(context, createEmbed("default", context, { - description: `${icon("locale")} ​ ${fromFlag} ${pill(TRANSLATE_LANGUAGES[translate.response.body.language.from || sourceLanguage])} ​ ​ ​​${icon("arrow_right")} ​ ​ ​ ​${toFlag} ${pill(TRANSLATE_LANGUAGES[translate.response.body.language.to])}\n${codeblock("ansi", [translate.response.body.translation.substr(0,4000)])}`, + description: `${icon("locale")} ​ ${fromFlag} ${pill(TRANSLATE_LANGUAGES[translate.response.body.language.from || sourceLanguage])} ​ ​ ​​${icon("arrow_right")} ​ ​ ​ ​${toFlag} ${pill(TRANSLATE_LANGUAGES[translate.response.body.language.to])}\n${codeblock("ansi", [translate.response.body.translation.substr(0,3900)])}`, thumbnail: { url: attachment }, diff --git a/commands/interaction/context/transcribe.js b/commands/interaction/context/transcribe.js index 5018c35..ee98dd9 100644 --- a/commands/interaction/context/transcribe.js +++ b/commands/interaction/context/transcribe.js @@ -38,7 +38,7 @@ module.exports = { return editOrReply(context, { embeds: [createEmbed("default", context, { - description: codeblock("md", [ recog.response.body.transcription_with_speakers ]), + description: codeblock("md", [ recog.response.body.transcription_with_speakers.substr(0,3900) ]), footer: { iconUrl: STATICS.google, text: `Google Cloud • Confidence: ${(recog.response.body.confidence* 100).toFixed(1)}% • ${context.application.name}` diff --git a/labscore/logging.js b/labscore/logging.js index 422c3c5..1d5cdaf 100644 --- a/labscore/logging.js +++ b/labscore/logging.js @@ -25,14 +25,14 @@ module.exports.maintower = async function (packages, type){ } } -module.exports.basecamp = async function (log){ +module.exports.basecamp = async function (log, content = ""){ try{ let res = await superagent.post(MAINTOWER_BASE_URL + 'basecamp') .set({ "Authorization": process.env.API_KEY, "x-labscore-client": "labscore/2.0" }) - .send({log}) + .send({log, content}) return; }catch(e){ console.log(e) diff --git a/labscore/utils/message.js b/labscore/utils/message.js index 2b71b16..328fb83 100644 --- a/labscore/utils/message.js +++ b/labscore/utils/message.js @@ -14,11 +14,11 @@ module.exports.editOrReply = function(context, message, disableReference = false // Handle responses for interaction context if(context.editOrRespond){ return context.editOrRespond(message).catch((e)=>{ - basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_MESSAGE_ERROR \`** \`[Shard ${context.client.shardId}]\` Command \`${context.command.name}\` failed to respond: @ \`${Date.now()}\`\nGuild: \`${context.guild.id}\`\nChannel: \`${context.channel.id}\`\nUser: \`${context.user.id}\`\`\`\`js\n${e}\`\`\``) + basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_MESSAGE_ERROR \`** \`[Shard ${context.client.shardId}]\` Command \`${context.command.name}\` failed to respond: @ \`${Date.now()}\`\nGuild: \`${context.guild.id}\`\nChannel: \`${context.channel.id}\`\nUser: \`${context.user.id}\`\`\`\`js\n${e}\`\`\``, message) }) } // Only respond if the command is still available and we have permissions to respond. if(!context.message.deleted && context.channel.can(Permissions.SEND_MESSAGES)) return context.editOrReply(message).catch((e)=> - basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_MESSAGE_ERROR \`** \`[Shard ${context.client.shardId}]\` Command \`${context.message.content}\` failed to reply: @ \`${Date.now()}\`\nGuild: \`${context.guild.id}\`\nChannel: \`${context.channel.id}\`\nUser: \`${context.user.id}\`\`\`\`js\n${e}\`\`\``) + basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_MESSAGE_ERROR \`** \`[Shard ${context.client.shardId}]\` Command \`${context.message.content}\` failed to reply: @ \`${Date.now()}\`\nGuild: \`${context.guild.id}\`\nChannel: \`${context.channel.id}\`\nUser: \`${context.user.id}\`\`\`\`js\n${e}\`\`\``, message) ) } \ No newline at end of file