import * as Discord from 'discord.js'; import { ReplaySubject } from 'rxjs'; import { CommandBase } from './CommandBase'; import { CommandParser, MESSAGE_TYPE } from './CommandParser'; import { Event } from './Event'; import { EVENT_OBJECT } from './EventObjectType'; declare class Bot { readonly EVENT_DISCORD_CONNECTED = "EVENT_DISCORD_CONNECTED"; readonly EVENT_DISCORD_DISCONNECTED = "EVENT_DISCORD_DISCONNECTED"; /** * Used for passing events to/from the bot context. */ events$: ReplaySubject<{ name: string; payload?: any; }>; /** * Discord.js Client */ client: Discord.Client; /** * Array of Command Class References */ commands: Array; /** * Array of Database Entities */ private entities; /** * Current working directory where the bot started. */ currentPath: string; /** * Called by the @Command decorated classes * * @param commandRef Command class reference. */ register(commandRef: CommandBase): void; /** * Start the bot. */ start(currentPath: string): Promise; /** * Handle an incoming event. * * @param event Event type. * @param eventobject Event Object from discord.js. */ handleEvent(event: Event, eventobject: EVENT_OBJECT): void; handleMessage(event: Event, message: MESSAGE_TYPE): void; preCommand(event: Event, parsedCommand: CommandParser): boolean; runCommand(event: Event, command: CommandParser): void; /** * Run a command based on an event. * * @param event Event type. * @param eventobject Event object. */ runEvent(event: Event, eventobject: EVENT_OBJECT): void; /** * Retrieves a registered command by it's name. * * @param name Name of the command. */ getCommandByName(name: string): CommandBase; /** * Retrieves a registered command by it's event type. */ getCommandByEvent(event: Event): CommandBase; } export declare const BOT: Bot; export {};