Merge branch 'main' into dev

This commit is contained in:
TrèsAbhi committed 2024-02-23 16:05:29 -06:00
commit 23a33c7722
45 files changed
+743 -504

No files matched your search

@@ -10,7 +10,6 @@ import {
import { commands } from '..';
import discord from '../../../../discord.json' assert { type: 'json' };
import buttonLink from '../../../core/discord/buttonLink';
import embedNegative from '../../../core/discord/embedNegative';
import embedWarning from '../../../core/discord/embedWarning';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
import { psa } from '../../../core/discord/psa';
@@ -19,7 +18,8 @@ import { UserError } from '../../../hooks/userError';
export default async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>,
) {
const registry = (await commands)[interaction.commandName];
const awaitedCommands = await commands;
const registry = awaitedCommands[interaction.commandName];
await interaction.deferReply();
@@ -118,25 +118,15 @@ export default async function handleChatInputCommand(
if (error instanceof UserError) {
interaction.editReply({
embeds: [
embedNegative(
error.message,
(error.cause as string | undefined) ??
'No further information is available.',
),
],
content: error.message,
components,
});
} else {
console.error(interaction.commandName, error);
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.",
),
],
content:
"# Blitzkrieg ran into an error!\nWe're so sorry about this. Feel free to [join the official Discord server](https://discord.gg/nDt7AjGJQH) to get help.",
components,
});
}