Files
blitzkit/src/core/blitz/wargamingError.ts
T

26 lines
736 B
TypeScript
Raw Normal View History

2023-04-26 23:06:04 +00:00
import {
CacheType,
ChatInputCommandInteraction,
EmbedBuilder,
} from 'discord.js';
2023-05-13 22:01:58 +00:00
import { NEGATIVE_COLOR } from '../../constants/colors.js';
2023-05-19 23:50:24 +00:00
import { handleError } from '../../events/error.js';
2023-05-13 22:01:58 +00:00
import { client } from '../../index.js';
2023-04-26 23:06:04 +00:00
export default async function wargamingError(
interaction: ChatInputCommandInteraction<CacheType>,
2023-05-02 23:01:54 +00:00
error: Error,
2023-05-06 18:03:37 +00:00
command: string,
2023-04-26 23:06:04 +00:00
) {
2023-04-27 01:15:57 +00:00
await interaction.editReply({
2023-04-26 23:06:04 +00:00
embeds: [
new EmbedBuilder()
.setColor(NEGATIVE_COLOR)
2023-04-28 13:52:31 +00:00
.setTitle(`${client.user?.username} ran into an issue`)
2023-04-26 23:06:04 +00:00
.setDescription('Wargaming returned an error. Please try again later.'),
],
});
2023-05-02 23:01:54 +00:00
console.log(`Wargaming returned an error`);
2023-05-06 18:03:37 +00:00
handleError(error, client, command);
2023-04-26 23:06:04 +00:00
}