nestjs-telegraf/lib/interfaces/telegraf-options.interface.ts

29 lines
817 B
TypeScript
Raw Permalink Normal View History

2020-03-19 16:21:35 +03:00
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
import { Middleware, Telegraf } from 'telegraf';
2020-01-12 01:15: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;
options?: Partial<Telegraf.Options<any>>;
launchOptions?: Telegraf.LaunchOptions | false;
2021-01-02 01:27:01 +03:00
include?: Function[];
middlewares?: ReadonlyArray<Middleware<any>>;
2020-01-12 01:15:32 +03:00
}
export interface TelegrafOptionsFactory {
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>;
useFactory?: (
...args: any[]
2020-03-19 16:21:35 +03:00
) => Promise<TelegrafModuleOptions> | TelegrafModuleOptions;
inject?: any[];
2020-01-12 01:15:32 +03:00
}