2020-03-19 16:21:35 +03:00
|
|
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
2021-01-23 19:51:29 +03:00
|
|
|
import { Middleware, Telegraf } from 'telegraf';
|
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;
|
2021-02-03 17:32:29 +03:00
|
|
|
options?: Partial<Telegraf.Options<any>>;
|
2021-02-20 06:14:27 +03:00
|
|
|
launchOptions?: Telegraf.LaunchOptions | false;
|
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 {
|
2021-01-23 19:51:46 +03:00
|
|
|
createTelegrafOptions(): Promise<TelegrafModuleOptions> | 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
|
|
|
}
|