2020-03-19 16:21:35 +03:00
|
|
|
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
2020-04-24 18:52:54 +03:00
|
|
|
import {
|
|
|
|
TelegrafOptions,
|
|
|
|
LaunchPollingOptions,
|
|
|
|
LaunchWebhookOptions,
|
2020-05-03 09:46:28 +03:00
|
|
|
} from 'telegraf/typings/telegraf';
|
2020-01-12 01:15:32 +03:00
|
|
|
|
|
|
|
export interface TelegrafModuleOptions {
|
2020-03-19 16:21:35 +03:00
|
|
|
token: string;
|
|
|
|
options?: TelegrafOptions;
|
2020-04-24 18:52:54 +03:00
|
|
|
launchOptions?: {
|
|
|
|
polling?: LaunchPollingOptions;
|
|
|
|
webhook?: LaunchWebhookOptions;
|
|
|
|
};
|
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'> {
|
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
|
|
|
}
|