import { ConfigService } from '@nestjs/config' ; import { ITelegramOptions } from 'src/telegram/telegram.interface' ; export const getTelegramConfig = ( configService ) : ITelegramOptions => { const token = configService . get ( 'TELEGRAM_TOKEN' ) ; if ( ! token ) { throw new Error ( 'TELEGRAM_TOKEN не задан' ) ; } return { token , chatId : configService . get ( 'CHAT_ID' ) ?? '' } ; } ;