Files
dsc-api/src/configs/telegraf.config.ts
T
2025-04-19 09:46:10 +03:30

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"),
}),
};
}