mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-24 23:14:39 +03:00
43816099a6
This reverts commit 2d23eba148
.
29 lines
817 B
TypeScript
29 lines
817 B
TypeScript
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
|
|
import { Middleware, Telegraf } from 'telegraf';
|
|
|
|
export interface TelegrafModuleOptions {
|
|
token: string;
|
|
botName?: string;
|
|
options?: Partial<Telegraf.Options<any>>;
|
|
launchOptions?: Telegraf.LaunchOptions | false;
|
|
include?: Function[];
|
|
middlewares?: ReadonlyArray<Middleware<any>>;
|
|
}
|
|
|
|
export interface TelegrafOptionsFactory {
|
|
createTelegrafOptions():
|
|
| Promise<TelegrafModuleOptions>
|
|
| TelegrafModuleOptions;
|
|
}
|
|
|
|
export interface TelegrafModuleAsyncOptions
|
|
extends Pick<ModuleMetadata, 'imports'> {
|
|
botName?: string;
|
|
useExisting?: Type<TelegrafOptionsFactory>;
|
|
useClass?: Type<TelegrafOptionsFactory>;
|
|
useFactory?: (
|
|
...args: any[]
|
|
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions;
|
|
inject?: any[];
|
|
}
|