From c1c8566934082a9d4ad6efc6b8d3671974dde11a Mon Sep 17 00:00:00 2001 From: georgemani1225 <49112969+georgemani1225@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:35:23 +0530 Subject: [PATCH 1/6] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 34fa95f..87d616a 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 || '875217300:AAFT4Tx2iWyV6gdcAHduEw2y9_QTwSMieYs', bot = new TelegramBot(token, { webHook: { port: port, From 5e23433b98bb9aa4970fa4b9932c00e6879cada9 Mon Sep 17 00:00:00 2001 From: georgemani1225 <49112969+georgemani1225@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:13:06 +0530 Subject: [PATCH 2/6] Update index.js --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.js b/index.js index 87d616a..fe914c9 100644 --- a/index.js +++ b/index.js @@ -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') +if(msg.text=="hello"){ + bot.sendMessage(chatId,'Hi') +else + bot.sendMessage(chatId,'pikka pe") + +}) From 63d88e3f735af2f4f6dca27d26d613bbd7bb4160 Mon Sep 17 00:00:00 2001 From: georgemani1225 <49112969+georgemani1225@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:25:50 +0530 Subject: [PATCH 3/6] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index fe914c9..46e6484 100644 --- a/index.js +++ b/index.js @@ -14,9 +14,9 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on('message',(msg) => { const chatId=msg.chat.id -if(msg.text=="hi"){ +if(msg=="hi"){ bot.sendMessage(chatId,'hello') -if(msg.text=="hello"){ +else if(msg=="hello"){ bot.sendMessage(chatId,'Hi') else bot.sendMessage(chatId,'pikka pe") From ebba4bf18d6074d31731e55922b76577f2353ab7 Mon Sep 17 00:00:00 2001 From: georgemani1225 <49112969+georgemani1225@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:27:28 +0530 Subject: [PATCH 4/6] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 46e6484..222f5b8 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,6 @@ if(msg=="hi"){ else if(msg=="hello"){ bot.sendMessage(chatId,'Hi') else - bot.sendMessage(chatId,'pikka pe") + bot.sendMessage(chatId,'pikka pe') }) From b2ede1bcd7589969a8349912209d09b5392853ef Mon Sep 17 00:00:00 2001 From: georgemani1225 <49112969+georgemani1225@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:29:27 +0530 Subject: [PATCH 5/6] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 222f5b8..20f9a6c 100644 --- a/index.js +++ b/index.js @@ -14,9 +14,9 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on('message',(msg) => { const chatId=msg.chat.id -if(msg=="hi"){ +if(msg.text=="hi"){ bot.sendMessage(chatId,'hello') -else if(msg=="hello"){ +else if(msg.text=="hello"){ bot.sendMessage(chatId,'Hi') else bot.sendMessage(chatId,'pikka pe') From 46e40fe73bd6fc2a5111f8f056e081f58b6e48d7 Mon Sep 17 00:00:00 2001 From: george mani Date: Mon, 14 Oct 2019 20:46:00 +0530 Subject: [PATCH 6/6] Updated code --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 20f9a6c..9f877d6 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ 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 = "https://geosapp.herokuapp.com", - token = process.env.TOKEN || '875217300:AAFT4Tx2iWyV6gdcAHduEw2y9_QTwSMieYs', + token = process.env.TOKEN || 'TYPE YOUR TOKEN HERE', bot = new TelegramBot(token, { webHook: { port: port, @@ -17,7 +17,7 @@ const chatId=msg.chat.id if(msg.text=="hi"){ bot.sendMessage(chatId,'hello') else if(msg.text=="hello"){ - bot.sendMessage(chatId,'Hi') + bot.sendMessage(chatId,'Hello') else bot.sendMessage(chatId,'pikka pe')