feat: express responses

This commit is contained in:
TresAbhi committed 2023-06-27 01:43:30 +00:00
1 parent 0f46f333b5
commit f2ae698438
45 files changed
+153 -93

No files matched your search

@@ -8,24 +8,24 @@ import {
import negativeEmbed from '../../../core/interaction/negativeEmbed.js';
import normalizeInteractionReturnable from '../../../core/interaction/normalizeInteractionReturnable.js';
import warningEmbed from '../../../core/interaction/warningEmbed.js';
import { psa } from '../../../core/process/psa.js';
import { psa } from '../../../core/node/psa.js';
import { handleError } from '../../error.js';
import { commands } from '../index.js';
export default async function handleChatInputCommand(
interaction: ChatInputCommandInteraction<CacheType>,
) {
const command = commands[interaction.commandName];
const registry = commands[interaction.commandName];
console.log(interaction.toString());
await interaction.deferReply();
try {
const returnable = await command.execute(interaction);
const returnable = await registry.handler(interaction);
if (command.handlesInteraction) return;
if (registry.handlesInteraction) return;
const reply = await normalizeInteractionReturnable(returnable!);
const reply = await normalizeInteractionReturnable(returnable);
if (psa.data) {
if (!reply.embeds) reply.embeds = [];