diff --git a/index.js b/index.js index 34fa95f..9f877d6 100644 --- a/index.js +++ b/index.js @@ -2,8 +2,8 @@ const TelegramBot = require('node-telegram-bot-api'); const port = process.env.PORT || 443, host = '0.0.0.0', // probably this change is not required - externalUrl = process.env.HOSTURL, - token = process.env.TOKEN || 'YOUR TELEGRAM TOKEN', + externalUrl = "https://geosapp.herokuapp.com", + token = process.env.TOKEN || 'TYPE YOUR TOKEN HERE', bot = new TelegramBot(token, { webHook: { port: port, @@ -11,3 +11,14 @@ const port = process.env.PORT || 443, } }); bot.setWebHook(externalUrl + ':443/bot' + token); + +bot.on('message',(msg) => { +const chatId=msg.chat.id +if(msg.text=="hi"){ + bot.sendMessage(chatId,'hello') +else if(msg.text=="hello"){ + bot.sendMessage(chatId,'Hello') +else + bot.sendMessage(chatId,'pikka pe') + +})