Created
July 13, 2020 00:52
-
-
Save spiritbroski/9c4d19f2736ae051d0cf2667128a94b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable,OnModuleInit } from '@nestjs/common'; | |
import { TelegramLib } from '../../lib/telegram'; | |
@Injectable() | |
export class TelegramService implements OnModuleInit{ | |
constructor( | |
private telegramLib:TelegramLib | |
) {} | |
onModuleInit() { | |
console.log(`Initialization... telegram`); | |
this.telegramLib.bot.on('text', (ctx) => { | |
console.log(ctx.update.message.from.id) | |
ctx.reply("id "+ctx.update.message.from.id+" username "+ctx.update.message.from.username) | |
}) | |
this.telegramLib.bot.launch() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment