feat: user error discrimination

This commit is contained in:
TrèsAbhi committed 2023-10-17 20:58:36 -05:00
1 parent f9e0584f00
commit 4b00e1342e
11 files changed
+49 -51

No files matched your search

@@ -7,10 +7,11 @@ import {
} from 'discord.js';
import { commands } from '..';
import discord from '../../../../discord.json' assert { type: 'json' };
import { psa } from '../../../core/discord/psa';
import { UserError } from '../../../core/blitzkrieg/userError';
import embedNegative from '../../../core/discord/embedNegative';
import embedWarning from '../../../core/discord/embedWarning';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
import { psa } from '../../../core/discord/psa';
export default async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>,
@@ -53,7 +54,9 @@ export default async function handleChatInputCommand(
.setStyle(ButtonStyle.Link),
);
console.error(interaction.commandName, error);
if (!(error instanceof UserError)) {
console.error(interaction.commandName, error);
}
await interaction.editReply({
embeds: [