Skip to content

Commit

Permalink
log /missing errors to channel
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Oct 13, 2023
1 parent 749f7ae commit 1d68e0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/commands/faithful/missing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
import axios from "axios";
import formatName from "@utility/formatName";
import minecraftSorter from "@utility/minecraftSorter";
import { devLogger } from "@helpers/logger";

export const command: SlashCommand = {
async data(client: Client): Promise<SyncSlashCommandBuilder> {
Expand Down Expand Up @@ -104,9 +105,12 @@ export const command: SlashCommand = {
if (!errMessage) {
console.error(err);
errMessage =
"An error occured when running /missing. Please check the console error output for more information.";
`An error occured when running /missing.\n\nInformation: ${err}`;
}

if (!this.client.tokens.dev)
devLogger(interaction.client, (err as Error).stack ?? (err as string), { codeBlocks: "" });

return [null, [errMessage], options];
};

Expand Down Expand Up @@ -158,9 +162,7 @@ export const command: SlashCommand = {
}

resultEmbed.addFields({
name: `${formatName(response[2].pack)[0]} - ${
response[2].version
}`,
name: `${formatName(response[2].pack)[0]} - ${response[2].version}`,
value: `${response[2].completion}% complete\n> ${response[1].length} ${
response[1].length == 1 ? "texture" : "textures"
} missing of ${response[2].total} total.`,
Expand Down

0 comments on commit 1d68e0c

Please sign in to comment.