@botonic/core
Version:
Runtime and APIs for Botonic bots: actions, context, messaging, and integration hooks used by the **current** framework line.
37 lines (36 loc) • 1.38 kB
TypeScript
import { Route } from '../routes/types';
import { BotonicContext, BotonicRequest, ResolvedPlugins, TypingMode } from '../server';
import { HubtypeApiService } from '../services/hubtype-api-service';
/** Config for CoreBot. */
export interface CoreBotConfig {
appId?: string;
defaultDelay?: number;
defaultRoutes?: (botonicContext: BotonicContext) => Route[];
defaultTyping?: number;
defaultTypingMode?: TypingMode;
plugins?: ResolvedPlugins;
routes: (botonicContext: BotonicContext) => Route[];
}
/**
* CoreBot: accepts v2-shaped `BotonicRequest` and runs
* input() → createBotonicContext → runInput (route, plugins, redirect).
*/
export declare class CoreBot {
appId?: string;
defaultDelay: number;
defaultRoutes: (botonicContext: BotonicContext) => Route[];
defaultTyping: number;
defaultTypingMode: TypingMode;
plugins: ResolvedPlugins;
routes: (botonicContext: BotonicContext) => Route[];
hubtypeService: HubtypeApiService;
private readonly botonicContextFactory;
constructor({ appId, defaultDelay, defaultRoutes, defaultTyping, defaultTypingMode, plugins, routes, }: CoreBotConfig);
run(botonicRequest: BotonicRequest): Promise<void>;
private runInput;
private runPrePlugins;
private getRoute;
private getCoreRoutes;
private runPostPlugins;
private runRedirectAction;
}