2024-03-19 17:41:20 -04:00
|
|
|
import { SlashCommandBuilder, ChatInputCommandInteraction } from "discord.js";
|
2024-04-02 16:38:00 -04:00
|
|
|
import { guildID } from "../config.json";
|
2024-03-19 17:41:20 -04:00
|
|
|
|
2024-04-05 20:11:59 -04:00
|
|
|
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 {
|
2024-03-19 17:41:20 -04:00
|
|
|
public name: string;
|
|
|
|
public description: string;
|
|
|
|
public builder: SlashCommandBuilder;
|
|
|
|
|
2024-04-05 20:11:59 -04:00
|
|
|
public GUILD_ID: string;
|
2024-04-02 16:38:00 -04:00
|
|
|
|
2024-03-22 00:18:20 -04:00
|
|
|
protected constructor(name: string, description: string) {
|
2024-03-19 17:41:20 -04:00
|
|
|
this.name = name;
|
|
|
|
this.description = description;
|
|
|
|
this.builder = new SlashCommandBuilder();
|
|
|
|
|
|
|
|
this.builder.setName(this.name);
|
|
|
|
this.builder.setDescription(this.description);
|
2024-04-02 16:38:00 -04:00
|
|
|
|
|
|
|
this.GUILD_ID = guildID;
|
2024-03-19 17:41:20 -04:00
|
|
|
}
|
|
|
|
|
2024-04-02 16:38:00 -04:00
|
|
|
public abstract execute(interaction: ChatInputCommandInteraction): Error | Promise<void | any>;
|
2024-03-19 17:41:20 -04:00
|
|
|
}
|