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