mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: better command error reporting
This commit is contained in:
1 parent
5ef1f87236
commit
92acbc8e95
16 files changed
+668
-31
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import {
|
||||
CacheType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
} from 'discord.js';
|
||||
import { handleError } from '../behaviors/error.js';
|
||||
import { NEGATIVE_COLOR } from '../constants/colors.js';
|
||||
import { client } from '../index.js';
|
||||
|
||||
export default async function blitzStarsError(
|
||||
interaction: ChatInputCommandInteraction<CacheType>,
|
||||
error: Error,
|
||||
command: string,
|
||||
) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
new EmbedBuilder()
|
||||
.setColor(NEGATIVE_COLOR)
|
||||
.setTitle(`${client.user?.username} ran into an issue`)
|
||||
.setDescription(
|
||||
'BlitzStars returned an error. Please try again later.',
|
||||
),
|
||||
],
|
||||
});
|
||||
|
||||
console.log(`BlitzStars returned an error`);
|
||||
handleError(error, client, command);
|
||||
}
|
||||
Reference in new issue
Block a user