@dexare/dbots
Version:
A Dexare module for the NPM package dbots
42 lines (41 loc) • 1.37 kB
TypeScript
import { DexareModule, DexareClient, BaseConfig } from 'dexare';
import { Poster } from 'dbots';
export interface DBotsConfig extends BaseConfig {
dbots?: DBotsModuleOptions;
}
export interface DBotsModuleOptions {
keys?: {
[service: string]: string;
};
interval?: number;
autopost?: boolean;
customServices?: any[];
}
export default class DBotsModule<T extends DexareClient<DBotsConfig>> extends DexareModule<T> {
private _keys?;
private _interval?;
private _customServices?;
/** The poster for the client. This gets created when the client is ready. */
poster?: Poster;
constructor(client: T);
/** @hidden */
load(): void;
/** @hidden */
unload(): void;
/** The keys for the poster. Defaults to `dbots.keys` in the config. */
get keys(): {
[service: string]: string;
};
set keys(keys: {
[service: string]: string;
});
/** The keys for the poster. Defaults to `dbots.customServices` in the config. */
get customServices(): any[];
set customServices(customServices: any[]);
/** The interval for the poster. Defaults to `dbots.interval` in the config. */
get interval(): number;
set interval(interval: number);
/** Short-hand for poster.startInterval */
startInterval(interval?: number): number | undefined;
onReady(): void;
}