declare module 'sqlite' { export interface Database {} export interface Statement {} } declare module 'discord.js-commando' { import { Channel, Client, ClientOptions, ClientUserSettings, Collection, DMChannel, Emoji, GroupDMChannel, Guild, GuildChannel, GuildMember, GuildResolvable, Message, MessageAttachment, MessageEmbed, MessageMentions, MessageOptions, MessageReaction, PermissionString, ReactionEmoji, RichEmbed, Role, Snowflake, StringResolvable, TextChannel, User, UserResolvable, Webhook } from 'discord.js'; import { Database as SQLiteDatabase, Statement as SQLiteStatement } from 'sqlite'; export class Argument { private constructor(client: CommandoClient, info: ArgumentInfo); private obtainInfinite(msg: CommandMessage, values?: string[], promptLimit?: number): Promise; private static validateInfo(client: CommandoClient, info: ArgumentInfo); public default: any; public infinite: boolean; public key: string; public label: string; public max: number; public min: number; public parser: Function; public prompt: string; public type: ArgumentType; public validator: Function; public wait: number; public obtain(msg: CommandMessage, value?: string, promptLimit?: number): Promise; public parse(value: string, msg: CommandMessage): any | Promise; public validate(value: string, msg: CommandMessage): boolean | string | Promise; } export class ArgumentCollector { public constructor(client: CommandoClient, args: ArgumentInfo[], promptLimit?: number); public args: Argument[]; public readonly client: CommandoClient; public promptLimit: number; public obtain(msg: CommandMessage, provided?: any[], promptLimit?: number): Promise; } export class ArgumentType { public constructor(client: CommandoClient, id: string); public readonly client: CommandoClient; public id: string; public parse(value: string, msg: CommandMessage, arg: Argument): any | Promise; public validate(value: string, msg: CommandMessage, arg: Argument): boolean | string | Promise; } export class Command { public constructor(client: CommandoClient, info: CommandInfo); private _globalEnabled: boolean; private _throttles: Map; private throttle(userID: string): object; private static validateInfo(client: CommandoClient, info: CommandInfo); public aliases: string[]; public argsCount: number; public argsSingleQuotes: boolean; public argsType: string; public readonly client: CommandoClient; public defaultHandling: boolean; public description: string; public details: string; public examples: string[]; public format: string; public group: CommandGroup; public groupID: string; public guarded: boolean; public guildOnly: boolean; public memberName: string; public name: string; public patterns: RegExp[]; public throttling: ThrottlingOptions; public hasPermission(message: CommandMessage): boolean | string; public isEnabledIn(guild: GuildResolvable, bypassGroup?: boolean): boolean; public isUsable(message: Message): boolean; public reload(): void; public run(message: CommandMessage, args: object | string | string[], fromPattern: boolean): Promise public setEnabledIn(guild: GuildResolvable, enabled: boolean): void; public unload(): void; public usage(argString?: string, prefix?: string, user?: User): string; public static usage(command: string, prefix?: string, user?: User): string; } export class CommandDispatcher { public constructor(client: CommandoClient, registry: CommandRegistry); private _awaiting: Set; private _commandPatterns: object; private _results: Map; private buildCommandPattern(prefix: string): RegExp; private cacheCommandMessage(message: Message, oldMessage: Message, cmdMsg: CommandMessage, responses: Message | Message[]): void; private handleMessage(messge: Message, oldMessage?: Message): Promise; private inhibit(cmdMsg: CommandMessage): [Inhibitor, undefined]; private matchDefault(message: Message, pattern: RegExp, commandNameIndex: number): CommandMessage; private parseMessage(message: Message): CommandMessage; private shouldHandleMessage(message: Message, oldMessage?: Message): boolean; public readonly client: CommandoClient; public inhibitors: Set; public registry: CommandRegistry; public addInhibitor(inhibitor: Inhibitor): boolean; public removeInhibitor(inhibitor: Inhibitor): boolean; } export class CommandFormatError extends FriendlyError { public constructor(msg: CommandMessage); } export class CommandGroup { public constructor(client: CommandoClient, id: string, name?: string, guarded?: boolean, commands?: Command[]); public readonly client: CommandoClient; public commands: Collection public guarded: boolean; public id: string; public name: string; public isEnabledIn(guild: GuildResolvable): boolean; public reload(): void; public setEnabledIn(guild: GuildResolvable, enabled: boolean): void; } export class CommandMessage { public constructor(message: Message, command?: Command, argString?: string, patternMatches?: string[]); private deleteRemainingResponses(): void; private editCurrentResponse(id: string, options?: {}): Promise; private editResponse(response: Message | Message[], options?: {}): Promise; private finalize(responses: Message | Message[]): void; private respond(options?: {}): Message | Message[]; public argString: string; public readonly attachments: Collection; public readonly author: User; public readonly channel: TextChannel | DMChannel | GroupDMChannel; public readonly cleanContent: string; public readonly client: CommandoClient; public command: Command; public readonly content: string; public readonly createdAt: Date; public readonly createdTimestamp: number; public readonly deletable: boolean; public readonly editable: boolean; public readonly editedAt: Date; public readonly editedTimestamp: number; public readonly edits: Message[]; public readonly embeds: MessageEmbed[]; public readonly guild: Guild; public readonly id: string; public readonly member: GuildMember; public readonly mentions: MessageMentions; public message: Message; public readonly nonce: string; public patternMatches: string[]; public readonly pinnable: boolean; public readonly pinned: boolean; public readonly reactions: Collection; public responsePositions: {}; public responses: {}; public readonly system: boolean; public readonly tts: boolean; public readonly webhookID: string; public anyUsage(command?: string, prefix?: string, user?: User): string; public clearReactions(): Promise; public code(lang: string, content: StringResolvable, options?: MessageOptions): Promise public delete(timeout?: number): Promise; public direct(content: StringResolvable, options?: MessageOptions): Promise; public edit(content: StringResolvable): Promise public editCode(lang: string, content: StringResolvable): Promise; public embed(embed: RichEmbed | {}, content?: StringResolvable, options?: MessageOptions): Promise; public fetchWebhook(): Promise; public isMemberMentioned(member: GuildMember | User): boolean; public isMentioned(data: GuildChannel | User | Role | string): boolean; public parseArgs(): string | string[]; public static parseArgs(argString: string, argCount?: number, allowSingleQuote?: boolean): string[]; public pin(): Promise public react(emoji: string | Emoji | ReactionEmoji): Promise; public reply(content: StringResolvable, options?: MessageOptions): Promise; public replyEmbed(embed: RichEmbed | {}, content?: StringResolvable, options?: MessageOptions): Promise; public run(): Promise; public say(content: StringResolvable, options?: MessageOptions): Promise; public unpin(): Promise; public usage(argString?: string, prefix?: string, user?: User): string; } export class CommandoClient extends Client { public constructor(options?: CommandoClientOptions); private _commandPrefix: string; public commandPrefix: string; public dispatcher: CommandDispatcher; public readonly owners: User[]; public provider: SettingProvider; public registry: CommandRegistry; public settings: GuildSettingsHelper; public isOwner(user: UserResolvable): boolean; public setProvider(provider: SettingProvider | Promise): Promise; on(event: string, listener: Function): this; on(event: 'commandBlocked', listener: (message: CommandMessage, reason: string) => void): this; on(event: 'commandError', listener: (command: Command, err: Error, message: CommandMessage, args: {} | string | string[], fromPattern: boolean) => void): this; on(event: 'commandPrefixChange', listener: (guild: Guild, prefix: string) => void): this; on(event: 'commandRegister', listener: (command: Command, registry: CommandRegistry) => void): this; on(event: 'commandReregister', listener: (newCommand: Command, oldCommand: Command) => void): this; on(event: 'commandRun', listener: (command: Command, promise: Promise, message: CommandMessage, args: object | string | string[], fromPattern: boolean) => void): this; on(event: 'commandStatusChange', listener: (guild: Guild, command: Command, enabled: boolean) => void): this; on(event: 'commandUnregister', listener: (command: Command) => void): this; on(event: 'groupRegister', listener: (group: CommandGroup, registry: CommandRegistry) => void): this; on(event: 'groupStatusChange', listener: (guild: Guild, group: CommandGroup, enabled: boolean) => void): this; on(event: 'typeRegister', listener: (type: ArgumentType, registry: CommandRegistry) => void): this; on(event: 'unknownCommand', listener: (message: CommandMessage) => void): this; on(event: 'channelCreate', listener: (channel: Channel) => void): this; on(event: 'channelDelete', listener: (channel: Channel) => void): this; on(event: 'channelPinsUpdate', listener: (channel: Channel, time: Date) => void): this; on(event: 'channelUpdate', listener: (oldChannel: Channel, newChannel: Channel) => void): this; on(event: 'clientUserSettingsUpdate', listener: (clientUserSettings: ClientUserSettings) => void): this; on(event: 'debug', listener: (info: string) => void): this; on(event: 'disconnect', listener: (event: any) => void): this; on(event: 'emojiCreate', listener: (emoji: Emoji) => void): this; on(event: 'emojiDelete', listener: (emoji: Emoji) => void): this; on(event: 'emojiUpdate', listener: (oldEmoji: Emoji, newEmoji: Emoji) => void): this; on(event: 'error', listener: (error: Error) => void): this; on(event: 'guildBanAdd', listener: (guild: Guild, user: User) => void): this; on(event: 'guildBanRemove', listener: (guild: Guild, user: User) => void): this; on(event: 'guildCreate', listener: (guild: Guild) => void): this; on(event: 'guildDelete', listener: (guild: Guild) => void): this; on(event: 'guildMemberAdd', listener: (member: GuildMember) => void): this; on(event: 'guildMemberAvailable', listener: (member: GuildMember) => void): this; on(event: 'guildMemberRemove', listener: (member: GuildMember) => void): this; on(event: 'guildMembersChunk', listener: (members: Collection, guild: Guild) => void): this; on(event: 'guildMemberSpeaking', listener: (member: GuildMember, speaking: boolean) => void): this; on(event: 'guildMemberUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this; on(event: 'guildUnavailable', listener: (guild: Guild) => void): this; on(event: 'guildUpdate', listener: (oldGuild: Guild, newGuild: Guild) => void): this; on(event: 'message', listener: (message: Message) => void): this; on(event: 'messageDelete', listener: (message: Message) => void): this; on(event: 'messageDeleteBulk', listener: (messages: Collection) => void): this; on(event: 'messageReactionAdd', listener: (messageReaction: MessageReaction, user: User) => void): this; on(event: 'messageReactionRemove', listener: (messageReaction: MessageReaction, user: User) => void): this; on(event: 'messageReactionRemoveAll', listener: (message: Message) => void): this; on(event: 'messageUpdate', listener: (oldMessage: Message, newMessage: Message) => void): this; on(event: 'presenceUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this; on(event: 'ready', listener: () => void): this; on(event: 'reconnecting', listener: () => void): this; on(event: 'roleCreate', listener: (role: Role) => void): this; on(event: 'roleDelete', listener: (role: Role) => void): this; on(event: 'roleUpdate', listener: (oldRole: Role, newRole: Role) => void): this; on(event: 'typingStart', listener: (channel: Channel, user: User) => void): this; on(event: 'typingStop', listener: (channel: Channel, user: User) => void): this; on(event: 'userNoteUpdate', listener: (user: UserResolvable, oldNote: string, newNote: string) => void): this; on(event: 'userUpdate', listener: (oldUser: User, newUser: User) => void): this; on(event: 'voiceStateUpdate', listener: (oldMember: GuildMember, newMember: GuildMember) => void): this; on(event: 'warn', listener: (info: string) => void): this; } export class CommandRegistry { public constructor(client?: CommandoClient); public readonly client: CommandoClient; public commands: Collection public commandsPath: string; public evalObjects: object; public groups: Collection public types: Collection public findCommands(searchString?: string, exact?: boolean, message?: Message | CommandMessage): Command[]; public findGroups(searchString?: string, exact?: boolean): CommandGroup[]; public registerCommand(command: Command | Function): CommandRegistry; public registerCommands(commands: Command[] | Function[]): CommandRegistry; public registerCommandsIn(options: string | {}): CommandRegistry; public registerDefaultCommands(options?: { help?: boolean, prefix?: boolean, eval_?: boolean, ping?: boolean, commandState?: boolean }): CommandRegistry; public registerDefaultGroups(): CommandRegistry; public registerDefaults(): CommandRegistry; public registerDefaultTypes(): CommandRegistry; public registerEvalObject(key: string, obj: {}): CommandRegistry; public registerEvalObjects(obj: {}): CommandRegistry; public registerGroup(group: CommandGroup | Function | string[] | string, name?: string): CommandRegistry; public registerGroups(groups: CommandGroup[] | Function[] | string[][]): CommandRegistry; public registerType(type: ArgumentType | Function): CommandRegistry; public registerTypes(type: ArgumentType[] | Function[]): CommandRegistry; public registerTypesIn(options: string | {}): CommandRegistry; public reregisterCommand(command: Command | Function, oldCommand: Command): void; public resolveCommand(command: CommandResolvable): Command; public resolveCommandPath(groups: string, memberName: string): string; public resolveGroup(group: CommandGroupResolvable): CommandGroup; public unregisterCommand(command: Command): void; } export class FriendlyError extends Error { public constructor(message: string); } export class GuildExtension extends Guild { private _commandPrefix: string; private _commandsEnabled: object; private _groupsEndabled: object; private _settings: GuildSettingsHelper; private static applyToClass(target: Function): void; public commandPrefix: string; public readonly settings: GuildSettingsHelper; public commandUsage(command?: string, user?: User): string; public isCommandEndabled(command: CommandResolvable): boolean; public isGroupEnabled(group: CommandGroupResolvable): boolean; public setCommandEnabled(command: CommandResolvable, enabled: boolean): void; public setGroupdEnabled(group: CommandGroupResolvable, enabled: boolean): void; } export class GuildSettingsHelper { public constructor(client: CommandoClient, guild: Guild); public readonly client: CommandoClient; public guild: Guild; public clear(): Promise; public get(key: string, defVal?: any): any; public remove(key: string): Promise; public set(key: string, value: any): Promise; } export class SettingProvider { public clear(guild: Guild | string): Promise; public destroy(): Promise; public get(guild: Guild | string, key: string, defVal?: any): any; public static getGuildID(guild: Guild | string): string; public init(client: CommandoClient): Promise; public remove(guild: Guild | string, key: string): Promise; public set(guild: Guild | string, key: string, val: any): Promise; } export class SQLiteProvider extends SettingProvider { public constructor(db: SQLiteDatabase); public readonly client: CommandoClient; public db: SQLiteDatabase; private deleteStmt: SQLiteStatement; private insertOrReplaceStmt: SQLiteStatement; private listeners: Map; private settings: Map; public clear(guild: Guild | string): Promise; public destroy(): Promise; public get(guild: Guild | string, key: string, defVal?: any): any; public init(client: CommandoClient): Promise; public remove(guild: Guild | string, key: string): Promise; public set(guild: Guild | string, key: string, val: any): Promise; private setupGuild(guild: string, settings: {}): void; private setupGuildCommand(guild: Guild, command: Command, settings: {}): void; private setupGuildGroup(guild: Guild, group: CommandGroup, settings: {}): void; private updateOtherShards(key: string, val: any): void; } export class util { public static disambiguation(items: any[], label: string, property?: string): string; public static paginate(items: T[], page?: number, pageLength?: number): { items: T[], page: number, maxPage: number, pageLength: number }; public static readonly permissions: { [K in PermissionString]: string }; } export const version: string; type ArgumentCollectorResult = { values?: object; cancelled?: 'user' | 'time' | 'promptLimit'; prompts: Message[]; answers: Message[]; }; type ArgumentInfo = { key: string; label?: string; prompt: string; type?: string; max?: number; min?: number; default?: any; infinite?: boolean; validate?: Function; parse?: Function; wait?: number; }; type ArgumentResult = { value: any | any[]; cancelled?: 'user' | 'time' | 'promptLimit'; prompts: Message[]; answers: Message[]; }; type CommandGroupResolvable = CommandGroup | string; type CommandInfo = { name: string; aliases?: string[]; autoAliases?: boolean; group: string; memberName: string; description: string; format?: string; details?: string; examples?: string[]; guildOnly?: boolean; defaultHandling?: boolean; throttling?: ThrottlingOptions; args?: ArgumentInfo[]; argsPromptLimit?: number; argsType?: string; argsCount?: number; argsSingleQuotes?: boolean; patterns?: RegExp[]; guarded?: boolean; ownerOnly?: boolean; }; type CommandoClientOptions = ClientOptions & { selfbot?: boolean; commandPrefix?: string; commandEditableDuration?: number; nonCommandEditable?: boolean; unknownCommandResponse?: boolean; owner?: string | string[] | Set; invite?: string; }; type CommandResolvable = Command | string; type Inhibitor = (msg: CommandMessage) => string | [string, Promise]; type ThrottlingOptions = { usages: number; duration: number; } }