From 9d710dc0dbe566f98d62635275fe336c8fff55d9 Mon Sep 17 00:00:00 2001 From: Matthew Date: Fri, 5 Apr 2024 20:11:59 -0400 Subject: [PATCH] provide typings for a DiscordInteractionCommand to be used primarily for subcommands --- util/DiscordInteractionCommand.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/util/DiscordInteractionCommand.ts b/util/DiscordInteractionCommand.ts index 1a089c8..9c7f5c2 100644 --- a/util/DiscordInteractionCommand.ts +++ b/util/DiscordInteractionCommand.ts @@ -1,12 +1,20 @@ import { SlashCommandBuilder, ChatInputCommandInteraction } from "discord.js"; import { guildID } from "../config.json"; -export default abstract class DiscordInteractionCommand { +export interface DiscordInteractionCommandSkeleton { + GUILD_ID: string; + builder?: SlashCommandBuilder; + description: string; + execute: (interaction: ChatInputCommandInteraction) => Error | Promise; + name: string; +} + +export default abstract class DiscordInteractionCommand implements DiscordInteractionCommandSkeleton { public name: string; public description: string; public builder: SlashCommandBuilder; - protected GUILD_ID: string; + public GUILD_ID: string; protected constructor(name: string, description: string) { this.name = name;