feat: simpler subcommands

This commit is contained in:
TrèsAbhi committed 2023-10-11 18:26:35 -05:00
1 parent f965452c5d
commit 78e4c82f20
28 files changed
+397 -461

No files matched your search

@@ -1,6 +1,5 @@
import { ButtonInteraction, CacheType } from 'discord.js';
import { commands } from '..';
import { CYCLIC_API } from '../../../constants/cyclic';
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable';
import throwError from '../../../core/node/throwError';
@@ -9,7 +8,7 @@ export default async function handleButton(
) {
await interaction.deferUpdate();
const url = new URL(`${CYCLIC_API}/${interaction.customId}`);
const url = new URL(`https://example.com/${interaction.customId}`);
const commandName = url.pathname.split('/')[1];
const button = (await commands)[commandName]?.button;
@@ -17,7 +17,6 @@ export default async function handleChatInputCommand(
) {
const registry = (await commands)[interaction.commandName];
console.log(interaction.toString());
await interaction.deferReply();
try {
+2 -1
View File
@@ -44,7 +44,8 @@ export type InteractionRawReturnable =
| EmbedBuilder
| ButtonBuilder
| AttachmentBuilder
| JSX.Element;
| JSX.Element
| null;
export type InteractionIterableReturnable =
| InteractionRawReturnable
| InteractionRawReturnable[];