mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
Merge branch 'main' into dev
This commit is contained in:
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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user