set return type for abstract execute() to Promise<void | any>
parent
ed90a4c3f9
commit
8cd51cac26
|
@ -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>;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue