corde
Version:
A simple library for Discord bot tests
54 lines (53 loc) • 1.49 kB
TypeScript
import { IConfigOptions, ICordeBot, TestFunctionType } from "../types";
import { Config } from "./config";
import { CordeBot } from "../core/cordeBot";
/**
* @internal
*/
declare class Runtime {
get bot(): ICordeBot;
get isTestEnv(): boolean;
get environment(): {
isUnityTest: boolean;
isE2eTest: boolean;
};
get exitOnFileReadingError(): boolean | undefined;
get extensions(): string[] | undefined;
get events(): import("../core/events").Events;
get configs(): Config;
get cordeBotToken(): string;
get botTestId(): string;
get project(): string | undefined;
get channelId(): string;
get guildId(): string;
get timeout(): number;
get botPrefix(): string;
get testMatches(): string[];
get modulePathIgnorePatterns(): string[];
private constructor();
private static _instance;
configFilePath: string;
files: string[];
private readonly _configs;
private _bot;
static getInstance(): Runtime;
setConfigs(_configs: Partial<IConfigOptions>, forceUpdate?: boolean): void;
replaceWithRootDir(text: string): string;
resolvePathWithRootDir(partialPath: string): string;
/**
* Shortcut for *bot.isLoggedIn*
*/
isBotLoggedIn(): boolean;
/**
* Shortcut for *bot.logout*
*/
logoffBot(): void;
loginBot(token: string): Promise<string>;
injectBot(fn: TestFunctionType): Promise<import("../types").ITestReport>;
initBot(): CordeBot;
}
/**
* Singleton of Runtime.
*/
declare const runtime: Runtime;
export { runtime };