provide typings for a DiscordInteractionCommand to be used primarily for subcommands

pull/1/head
Matthew 2024-04-05 20:11:59 -04:00
parent 98c1e83770
commit 9d710dc0db
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
1 changed files with 10 additions and 2 deletions

View File

@ -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<void | any>;
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;