mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: simpler non-user error messaging
This commit is contained in:
1 parent
44f03a1fce
commit
d1ebb79432
1 file changed
+30
-16
@@ -47,25 +47,39 @@ export default async function handleChatInputCommand(
|
||||
|
||||
await interaction.editReply(reply);
|
||||
} catch (error) {
|
||||
const actionRow = new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setLabel('Get Help on Discord Server')
|
||||
.setURL('https://discord.gg/nDt7AjGJQH')
|
||||
.setStyle(ButtonStyle.Link),
|
||||
);
|
||||
const components = [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setLabel('Get Help on Discord Server')
|
||||
.setURL('https://discord.gg/nDt7AjGJQH')
|
||||
.setStyle(ButtonStyle.Link),
|
||||
),
|
||||
];
|
||||
|
||||
if (!(error instanceof UserError)) {
|
||||
console.error(interaction.commandName, error);
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
embedNegative(
|
||||
(error as Error).message,
|
||||
`${(error as Error).cause ?? 'No further information is available.'}`,
|
||||
),
|
||||
],
|
||||
components: [actionRow],
|
||||
});
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
embedNegative(
|
||||
(error as Error).message,
|
||||
`${
|
||||
(error as Error).cause ?? 'No further information is available.'
|
||||
}`,
|
||||
),
|
||||
],
|
||||
components,
|
||||
});
|
||||
} else {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
embedNegative(
|
||||
'Blitzkrieg ran into an error!',
|
||||
"We're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
|
||||
),
|
||||
],
|
||||
components,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user