more messaging changes

This commit is contained in:
derpystuff 2023-07-16 23:39:20 +02:00
parent 9c66e6af95
commit 60a0316cbc
2 changed files with 2 additions and 2 deletions

View file

@ -133,7 +133,7 @@ commandClient.on('commandRunError', async ({context, error}) => {
const message = `Shard #${shard.shardId}: (NOT OK) ${response.statusCode} ${response.request.method}-${response.request.url} (${route.path})`; const message = `Shard #${shard.shardId}: (NOT OK) ${response.statusCode} ${response.request.method}-${response.request.url} (${route.path})`;
console.log(message); console.log(message);
console.log(await response.text()); console.log(await response.text());
await basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_REST_ERROR \`** Shard ${shard.shardId} received request error \`${response.statusCode}\` @ \`${Date.now()}\`\n**\` ${response.request.method} \`** \`${response.request.url}\` (${route.path})\n\`\`\`js\n${await response.text()}\`\`\``) await basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_REST_ERROR \`** \`[Shard ${shard.shardId}]\` Shard request error: \`${response.statusCode}\` @ \`${Date.now()}\`\n**\` ${response.request.method} \`** \`${response.request.url}\` (${route.path})\n\`\`\`js\n${await response.text()}\`\`\``)
} }
} }
}); });

View file

@ -9,6 +9,6 @@ module.exports.editOrReply = function(context, message, disableReference = false
if(!message.allowedMentions) message.allowedMentions = {parse: [], repliedUser: false} if(!message.allowedMentions) message.allowedMentions = {parse: [], repliedUser: false}
// Only respond if the command is still available and we have permissions to respond. // 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)=> 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 \`** \`[${context.client.shardId}\` Command \`${context.command.name}\` failed to reply: @ \`${Date.now()}\`\n\`\`\`js\n${e}\`\`\``) basecamp(`<:ico_w3:1086624963047460874>\`[${process.env.HOSTNAME}]\` **\` SHARD_MESSAGE_ERROR \`** \`[Shard ${context.client.shardId}]\` Command \`${context.command.name}\` failed to reply: @ \`${Date.now()}\`\n\`\`\`js\n${e}\`\`\``)
) )
} }