2020-03-19 16:21:35 +03:00
|
|
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
2022-11-20 14:16:17 +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;
|
2022-11-20 14:16:17 +03:00
|
|
|
options?: Partial<Telegraf.Options<any>>;
|
|
|
|
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 {
|
2022-07-09 12:40:49 +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
|
|
|
}
|