thaldrin/src/handler/structures/Command.ts

33 lines
977 B
TypeScript
Raw Normal View History

2021-04-08 22:42:39 +00:00
import { Context, Command as CommandContext } from "../../utils/types";
export default class Command {
name: string;
description: string;
aliases: string[];
module: string;
cooldown: number;
guild: boolean;
dev: boolean;
nsfw: boolean;
AuthorPermissions: string | string[];
hidden: boolean;
2021-05-05 23:19:58 +00:00
usage: string
2021-04-08 22:42:39 +00:00
constructor(command: CommandContext) {
2021-05-10 15:22:52 +00:00
this.name = command.name || "generic";
this.description = command.description || "generic command base";
2021-04-08 22:42:39 +00:00
this.aliases = command.aliases || [];
this.module = command.module || "";
2021-05-10 15:22:52 +00:00
this.cooldown = command.cooldown || 1;
2021-04-08 22:42:39 +00:00
this.guild = command.guild || false;
this.dev = command.dev || false;
this.nsfw = command.nsfw || false;
this.AuthorPermissions = command.AuthorPermissions || "NONE";
this.hidden = command.hidden || false;
2021-05-05 23:19:58 +00:00
this.usage = command.usage || ''
2021-04-08 22:42:39 +00:00
}
async run(ctx: Context) {
2021-04-21 00:28:35 +00:00
ctx.channel.send("This is the default command, overwrite me.")
2021-04-08 22:42:39 +00:00
}
};