bot/src/plugins/Command.ts

28 lines
569 B
TypeScript
Raw Normal View History

2020-01-13 22:38:12 +00:00
import { Message, PermissionString } from 'discord.js';
import { PluginClient } from '../PluginClient';
import { UserDoc } from '../models/User';
2020-01-13 22:38:12 +00:00
type CommandFunction = (
lifeguard: PluginClient,
msg: Message,
args: string[],
dbUser: UserDoc
2020-01-13 22:38:12 +00:00
) => void;
interface CommandOptions {
alias?: string[];
guildOnly?: boolean;
hidden?: boolean;
level: number;
usage: string[];
permissions?: PermissionString[];
}
export class Command {
constructor(
public name: string,
public func: CommandFunction,
public options: CommandOptions
) {}
}