feat: update bot chunk 4

This commit is contained in:
tresabhi committed 2025-01-16 14:10:28 -06:00
1 parent 5499cb5cca
commit 98724df711
11 files changed
+122 -91

No files matched your search

@@ -2,11 +2,13 @@ import {
ActionRowBuilder,
AttachmentBuilder,
ButtonBuilder,
ButtonStyle,
CacheType,
ChatInputCommandInteraction,
InteractionReplyOptions,
} from 'discord.js';
import { InteractionRawReturnable, commands } from '..';
import { UserError } from '../../../core/blitzkit/userError';
import { buttonLink } from '../../../core/discord/buttonLink';
import { embedWarning } from '../../../core/discord/embedWarning';
import { normalizeInteractionReturnable } from '../../../core/discord/normalizeInteractionReturnable';
@@ -124,26 +126,27 @@ export async function handleChatInputCommand(
index++;
}
} catch (error) {
const { t } = translator(interaction.locale);
// const components = [
// new ActionRowBuilder<ButtonBuilder>().addComponents(
// new ButtonBuilder()
// .setLabel(t`bot.common.errors.get_help`)
// .setURL('https://discord.gg/nDt7AjGJQH')
// .setStyle(ButtonStyle.Link),
// ),
// ];
// if (error instanceof UserError) {
// interaction.editReply({
// content: error.message,
// components,
// });
// } else {
// console.error(interaction.commandName, error);
// interaction.editReply({
// content: t`bot.common.errors.uncaught_error`,
// components,
// });
// }
const { strings } = translator(interaction.locale);
const components = [
new ActionRowBuilder<ButtonBuilder>().addComponents(
new ButtonBuilder()
.setLabel(strings.bot.common.errors.get_help)
.setURL('https://discord.gg/nDt7AjGJQH')
.setStyle(ButtonStyle.Link),
),
];
if (error instanceof UserError) {
interaction.editReply({
content: error.message,
components,
});
} else {
console.error(interaction.commandName, error);
interaction.editReply({
content: strings.bot.common.errors.uncaught_error,
components,
});
}
}
}