set return type for abstract execute() to Promise<void | any>

master
Matthew 2024-04-02 16:38:00 -04:00
parent ed90a4c3f9
commit 8cd51cac26
Signed by: matthew
SSH Key Fingerprint: SHA256:piIXekA9q1p0ZGi4ogFbNY1embip5Ytbi3v8AZ8UYq4
1 changed files with 6 additions and 1 deletions

View File

@ -1,10 +1,13 @@
import { SlashCommandBuilder, ChatInputCommandInteraction } from "discord.js"; import { SlashCommandBuilder, ChatInputCommandInteraction } from "discord.js";
import { guildID } from "../config.json";
export default abstract class DiscordInteractionCommand { export default abstract class DiscordInteractionCommand {
public name: string; public name: string;
public description: string; public description: string;
public builder: SlashCommandBuilder; public builder: SlashCommandBuilder;
protected GUILD_ID: string;
protected constructor(name: string, description: string) { protected constructor(name: string, description: string) {
this.name = name; this.name = name;
this.description = description; this.description = description;
@ -12,7 +15,9 @@ export default abstract class DiscordInteractionCommand {
this.builder.setName(this.name); this.builder.setName(this.name);
this.builder.setDescription(this.description); this.builder.setDescription(this.description);
this.GUILD_ID = guildID;
} }
public abstract execute(interaction: ChatInputCommandInteraction): Error | Promise<void>; public abstract execute(interaction: ChatInputCommandInteraction): Error | Promise<void | any>;
} }