From ffd987ecb4969c85b2925df0373ca788dcbf799b Mon Sep 17 00:00:00 2001 From: Zack Campbell Date: Wed, 15 Mar 2017 08:50:03 -0500 Subject: [PATCH] Add BaseCommandName type --- src/index.ts | 1 + src/lib/types/BaseCommandName.ts | 13 +++++++++++++ src/lib/types/BotOptions.ts | 4 +++- src/lib/types/CommandInfo.ts | 3 ++- 4 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/lib/types/BaseCommandName.ts diff --git a/src/index.ts b/src/index.ts index a0c754f0..c58cb288 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,6 +20,7 @@ export { ExpectArgType } from './lib/types/ExpectArgType'; export { Guild } from './lib/types/Guild'; export { Message } from './lib/types/Message'; export { ResolveArgType } from './lib/types/ResolveArgType'; +export { BaseCommandName } from './lib/types/BaseCommandName'; export const version: string = require(path.join(__dirname, '..', 'package')).version; diff --git a/src/lib/types/BaseCommandName.ts b/src/lib/types/BaseCommandName.ts new file mode 100644 index 00000000..99936c9c --- /dev/null +++ b/src/lib/types/BaseCommandName.ts @@ -0,0 +1,13 @@ +export type BaseCommandName = 'blacklist' + | 'whitelist' + | 'clearlimit' + | 'disablegroup' + | 'enablegroup' + | 'limit' + | 'listgroups' + | 'eval' + | 'help' + | 'ping' + | 'reload' + | 'setprefix' + | 'version'; diff --git a/src/lib/types/BotOptions.ts b/src/lib/types/BotOptions.ts index e251d683..35e34005 100644 --- a/src/lib/types/BotOptions.ts +++ b/src/lib/types/BotOptions.ts @@ -1,3 +1,5 @@ +import { BaseCommandName } from './BaseCommandName'; + export type BotOptions = { name: string; token: string; @@ -8,7 +10,7 @@ export type BotOptions = { selfbot?: boolean; passive?: boolean; version?: string; - disableBase?: string[]; + disableBase?: BaseCommandName[]; config: any; }; diff --git a/src/lib/types/CommandInfo.ts b/src/lib/types/CommandInfo.ts index 2e936e4d..720cfc01 100644 --- a/src/lib/types/CommandInfo.ts +++ b/src/lib/types/CommandInfo.ts @@ -1,4 +1,5 @@ import { PermissionResolvable } from 'discord.js'; +import { BaseCommandName } from './BaseCommandName'; import { ArgOpts } from './ArgOpts'; export type CommandInfo = { @@ -14,7 +15,7 @@ export type CommandInfo = { permissions?: PermissionResolvable[]; roles?: string[]; ownerOnly?: boolean; - overloads?: string; + overloads?: BaseCommandName; }; /**