import { type ChatInputApplicationCommandStructure } from '@projectdysnomia/dysnomia'; import type { ExecutableInteraction } from '../types/interaction.type'; import type { ChatCommandDefinition, CommandContext, CommandHandler } from '../types'; export function createChatCommand( definition: ChatCommandDefinition, execute: (interaction: ExecutableInteraction, ctx: CommandContext) => Promise, ): CommandHandler { const def = definition as ChatInputApplicationCommandStructure; def.type = 1; // CHAT_INPUT return { definition: def, execute, }; }