mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 03:29:51 +02:00
feat: added all buttons to dynamic commands
This commit is contained in:
1 parent
dd39563d6d
commit
d1d8aad6c7
9 files changed
+157
-57
No files matched your search
@@ -1,11 +1,13 @@
|
||||
import { ButtonInteraction, CacheType } from 'discord.js';
|
||||
import { CYCLIC_API } from '../../../constants/cyclic.js';
|
||||
import normalizeInteractionReturnable from '../../../core/discord/normalizeInteractionReturnable.js';
|
||||
import { commands } from '../index.js';
|
||||
|
||||
export default async function handleButton(
|
||||
interaction: ButtonInteraction<CacheType>,
|
||||
) {
|
||||
const commandName = interaction.customId.split('/')[0];
|
||||
const url = new URL(`${CYCLIC_API}/${interaction.customId}`);
|
||||
const commandName = url.pathname.split('/')[1];
|
||||
const button = commands[commandName]?.button;
|
||||
|
||||
if (!button) {
|
||||
|
||||
Reference in new issue
Block a user