mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-07 21:53:07 -04:00
catch potential crash issue
This commit is contained in:
parent
e23053650e
commit
bbf34590c6
1 changed files with 28 additions and 24 deletions
|
@ -48,6 +48,8 @@ module.exports.editOrReply = function(context, message, disableReference = false
|
||||||
}
|
}
|
||||||
|
|
||||||
return context.editOrRespond(message).catch(async (e)=>{
|
return context.editOrRespond(message).catch(async (e)=>{
|
||||||
|
try{
|
||||||
|
|
||||||
const errorData = await e.response.json();
|
const errorData = await e.response.json();
|
||||||
if(MESSAGE_BLOCK_REASONS[errorData.code]){
|
if(MESSAGE_BLOCK_REASONS[errorData.code]){
|
||||||
// Delete the public response
|
// Delete the public response
|
||||||
|
@ -74,7 +76,9 @@ module.exports.editOrReply = function(context, message, disableReference = false
|
||||||
context._meta.replacementMessageId = replacementMessage.id;
|
context._meta.replacementMessageId = replacementMessage.id;
|
||||||
|
|
||||||
return replacementMessage;
|
return replacementMessage;
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
console.log(e)
|
||||||
}
|
}
|
||||||
basecamp(formatErrorMessage(3, "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);
|
basecamp(formatErrorMessage(3, "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);
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue