report request content to basecamp

This commit is contained in:
derpystuff 2024-03-24 11:33:46 +01:00
parent a3ae9d819c
commit a2f195f983
5 changed files with 7 additions and 7 deletions

View file

@ -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`

View file

@ -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
},

View file

@ -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}`

View file

@ -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)

View file

@ -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)
)
}