import { Member, Message, TextableChannel } from 'eris'; import { Client } from '.'; export default class Command { public client: Client; /** * The name of the command */ public name: string; /** * The description for the command. */ public description: string; /** * Usage for the command. */ public usage: string; /** * The aliases for the command. */ public aliases: string[]; /** * - **0:** Everyone * - **1:** Associates Team+ * - **2:** Sheriff+ * - **3:** Faculty Marshals+ * - **4:** Marshal Generals of Engineering */ public permissions: number; /** * Determines if the command is only available in server. */ public guildOnly: boolean; /** * Determines if the command is enabled or not. */ public enabled: boolean; public run(message: Message, args: string[]): Promise { return Promise.resolve(); } constructor(client: Client) { this.client = client; this.aliases = []; } public checkPermissions(member: Member): boolean { if (member.id === '278620217221971968' || member.id === '253600545972027394') return true; switch (this.permissions) { case 0: return true; case 1: return member.roles.some((r) => ['662163685439045632', '455972169449734144', '453689940140883988'].includes(r)); case 2: return member.roles.some((r) => ['662163685439045632', '455972169449734144'].includes(r)); case 3: return member.roles.some((r) => ['662163685439045632'].includes(r)); case 4: return member.id === '278620217221971968' || member.id === '253600545972027394'; default: return false; } } public error(channel: TextableChannel, text: string): Promise { return channel.createMessage(`***${this.client.util.emojis.ERROR} ${text}***`); } public success(channel: TextableChannel, text: string): Promise { return channel.createMessage(`***${this.client.util.emojis.SUCCESS} ${text}***`); } public loading(channel: TextableChannel, text: string): Promise { return channel.createMessage(`***${this.client.util.emojis.LOADING} ${text}***`); } }