2020-03-19 16:21:35 +03:00
|
|
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
2021-01-11 16:17:32 +03:00
|
|
|
import { Middleware } from 'telegraf';
|
|
|
|
import { LaunchOptions, TelegrafOptions } from '../types';
|
2020-01-12 01:15:32 +03:00
|
|
|
|
2021-01-11 16:17:32 +03:00
|
|
|
export interface TelegrafModuleOptions {
|
2020-03-19 16:21:35 +03:00
|
|
|
token: string;
|
2021-01-05 13:36:12 +03:00
|
|
|
botName?: string;
|
2020-03-19 16:21:35 +03:00
|
|
|
options?: TelegrafOptions;
|
2021-01-11 16:17:32 +03:00
|
|
|
launchOptions?: LaunchOptions;
|
2021-01-02 01:27:01 +03:00
|
|
|
include?: Function[];
|
2021-01-11 16:17:32 +03:00
|
|
|
middlewares?: ReadonlyArray<Middleware<any>>;
|
2020-01-12 01:15:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TelegrafOptionsFactory {
|
2020-03-19 16:21:35 +03:00
|
|
|
createTelegrafOptions(): TelegrafModuleOptions;
|
2020-01-12 01:15:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface TelegrafModuleAsyncOptions
|
|
|
|
extends Pick<ModuleMetadata, 'imports'> {
|
2021-01-05 13:36:12 +03:00
|
|
|
botName?: string;
|
2020-03-19 16:21:35 +03:00
|
|
|
useExisting?: Type<TelegrafOptionsFactory>;
|
|
|
|
useClass?: Type<TelegrafOptionsFactory>;
|
2020-01-12 01:36:53 +03:00
|
|
|
useFactory?: (
|
|
|
|
...args: any[]
|
2020-03-19 16:21:35 +03:00
|
|
|
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions;
|
|
|
|
inject?: any[];
|
2020-01-12 01:15:32 +03:00
|
|
|
}
|