13 lines
427 B
TypeScript
Executable File
13 lines
427 B
TypeScript
Executable File
import { ConfigService } from "@nestjs/config";
|
|
import { TelegrafModuleAsyncOptions } from "nestjs-telegraf";
|
|
|
|
export function telegrafConfig(): TelegrafModuleAsyncOptions {
|
|
return {
|
|
inject: [ConfigService],
|
|
useFactory: async (configService: ConfigService) => ({
|
|
token: configService.getOrThrow<string>("TELEGRAM_BOT_TOKEN"),
|
|
botName: configService.getOrThrow<string>("TELEGRAM_BOT_NAME"),
|
|
}),
|
|
};
|
|
}
|