mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-24 23:14:39 +03:00
feat(telegrambot.ts): use Nest logger
This commit is contained in:
parent
9606daaf63
commit
2617c19af9
@ -1,4 +1,4 @@
|
||||
import { Injectable, Inject } from '@nestjs/common'
|
||||
import { Injectable, Inject, Logger } from '@nestjs/common'
|
||||
import { ModuleRef } from '@nestjs/core'
|
||||
import Telegraf, { ContextMessageUpdate } from 'telegraf'
|
||||
import { flatten, head } from 'lodash'
|
||||
@ -15,6 +15,7 @@ import { InvalidConfigurationException } from './InvalidConfigurationException'
|
||||
|
||||
@Injectable()
|
||||
export class TelegramBot {
|
||||
private readonly logger = new Logger(TelegramBot.name, true);
|
||||
private readonly sitePublicUrl?: string
|
||||
private readonly bot: Bot
|
||||
private ref: ModuleRef
|
||||
@ -54,7 +55,7 @@ export class TelegramBot {
|
||||
|
||||
this.bot.telegram
|
||||
.setWebhook(url)
|
||||
.then(() => console.log(`Webhook set success @ ${url}`))
|
||||
.then(() => Logger.log(`Webhook set success @ ${url}`))
|
||||
|
||||
return this.bot.webhookCallback(`/${path}`)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user