From d210fdc6ccbd86222d8be7299300ef9ca1e16195 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:45:40 +0530 Subject: [PATCH 01/28] Update index.js --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 34fa95f..bb90ce4 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://terbo.herokuapp.com', + token = process.env.TOKEN || '832140817:AAFZJxqITBiXcby0FVGQ9KEtNkik3yIFDAo', bot = new TelegramBot(token, { webHook: { port: port, @@ -11,3 +11,8 @@ const port = process.env.PORT || 443, } }); bot.setWebHook(externalUrl + ':443/bot' + token); +bot.on("message", (msg,) => { + + const chatId = msg.chat.id + bot.sendMessage(chatId, "received your message"); +}); From efeaf145a45e3ee0516c81fcecc239f18885cfc7 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:55:02 +0530 Subject: [PATCH 02/28] Update index.js --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index bb90ce4..f706e9f 100644 --- a/index.js +++ b/index.js @@ -14,5 +14,7 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on("message", (msg,) => { const chatId = msg.chat.id - bot.sendMessage(chatId, "received your message"); + if(msg.chat.id=="hai") + + bot.sendMessage(chatId, "hello"); }); From 9ec745922260fee5fb231c20c7fc7eee8b9c216b Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:56:05 +0530 Subject: [PATCH 03/28] Update index.js --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index f706e9f..4cd4f41 100644 --- a/index.js +++ b/index.js @@ -13,8 +13,7 @@ const port = process.env.PORT || 443, bot.setWebHook(externalUrl + ':443/bot' + token); bot.on("message", (msg,) => { - const chatId = msg.chat.id - if(msg.chat.id=="hai") + const chatId = msg.chat.id bot.sendMessage(chatId, "hello"); }); From 92271fa9577d27f00b808ab50c516debc5685168 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:57:55 +0530 Subject: [PATCH 04/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 4cd4f41..44176e2 100644 --- a/index.js +++ b/index.js @@ -15,5 +15,5 @@ bot.on("message", (msg,) => { const chatId = msg.chat.id - bot.sendMessage(chatId, "hello"); + bot.sendMessage(chatId, "hell"); }); From 428330eb2e877fe9cef43f354860056bcc26c0bf Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:01:22 +0530 Subject: [PATCH 05/28] Update index.js --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 44176e2..3f678f5 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,8 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on("message", (msg,) => { const chatId = msg.chat.id - - bot.sendMessage(chatId, "hell"); + if(chatId=="hai"){ + bot.sendMessage(chatId, "hello");} + else{ + bot.sendmessage(chatId,"received")} }); From 61252fa62aac0b9676b7e34eb509fb9e586637be Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:03:08 +0530 Subject: [PATCH 06/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3f678f5..063d4ef 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on("message", (msg,) => { const chatId = msg.chat.id - if(chatId=="hai"){ + if(msg.text=="hai"){ bot.sendMessage(chatId, "hello");} else{ bot.sendmessage(chatId,"received")} From b1bc40b1071288cca071aeaa76bcd290d0c40d51 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:07:52 +0530 Subject: [PATCH 07/28] Update index.js --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 063d4ef..0fdd5ca 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,9 @@ bot.on("message", (msg,) => { const chatId = msg.chat.id if(msg.text=="hai"){ - bot.sendMessage(chatId, "hello");} + bot.sendMessage(chatId, "hello"); + } else{ - bot.sendmessage(chatId,"received")} + bot.sendMessage(chatId,"received") + } }); From 44665cd7585d8b62c99e95c5984112edddf8aac9 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:10:24 +0530 Subject: [PATCH 08/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0fdd5ca..76a236d 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on("message", (msg,) => { const chatId = msg.chat.id - if(msg.text=="hai"){ + if(msg.text=="Hai" || "Hello"){ bot.sendMessage(chatId, "hello"); } else{ From 3f8b8810787c5fdca3f6ebffbc5e513ade63f0a9 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:13:24 +0530 Subject: [PATCH 09/28] Update index.js --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 76a236d..5cdbe92 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,8 @@ bot.on("message", (msg,) => { if(msg.text=="Hai" || "Hello"){ bot.sendMessage(chatId, "hello"); } - else{ + else { + bot.sendMessage(chatId,"received") } }); From 58bb91baac34aca8c2e4c2d8cd4ecb44493bfa01 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:14:04 +0530 Subject: [PATCH 10/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5cdbe92..3d91727 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on("message", (msg,) => { const chatId = msg.chat.id - if(msg.text=="Hai" || "Hello"){ + if(msg.text=="Hai" || msg.text=="Hello"){ bot.sendMessage(chatId, "hello"); } else { From 5e2730b284152a485a686029aebf403ef26542d9 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:18:19 +0530 Subject: [PATCH 11/28] Update index.js --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 3d91727..b08c400 100644 --- a/index.js +++ b/index.js @@ -17,6 +17,9 @@ bot.on("message", (msg,) => { if(msg.text=="Hai" || msg.text=="Hello"){ bot.sendMessage(chatId, "hello"); } + if(msg.text=="How are you?" || msg.text=="How r u?"){ + bot.sendMessage(chatId,"Ha HA fine...") + } else { bot.sendMessage(chatId,"received") From af38843119ae7ff5a9b119225693a465ca41f91a Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:22:59 +0530 Subject: [PATCH 12/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b08c400..a45a72d 100644 --- a/index.js +++ b/index.js @@ -17,7 +17,7 @@ bot.on("message", (msg,) => { if(msg.text=="Hai" || msg.text=="Hello"){ bot.sendMessage(chatId, "hello"); } - if(msg.text=="How are you?" || msg.text=="How r u?"){ + else if(msg.text=="How are you?" || msg.text=="How r u?"){ bot.sendMessage(chatId,"Ha HA fine...") } else { From 732daed9e35f33d4f0836687619c86c14a1396bf Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:28:05 +0530 Subject: [PATCH 13/28] Update index.js --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index a45a72d..e0992a6 100644 --- a/index.js +++ b/index.js @@ -20,8 +20,11 @@ bot.on("message", (msg,) => { else if(msg.text=="How are you?" || msg.text=="How r u?"){ bot.sendMessage(chatId,"Ha HA fine...") } - else { - - bot.sendMessage(chatId,"received") + else if {msg.text=="I love you" || msg.text=="I love u"){ + + bot.sendMessage(chatId,"love u toooo") + } + else{ + bot.sendMessage(chatId,"received") } }); From fad6adba3838822dbb2d641afb879b6dbd82cda8 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:29:44 +0530 Subject: [PATCH 14/28] Update index.js --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index e0992a6..3b22a73 100644 --- a/index.js +++ b/index.js @@ -18,13 +18,13 @@ bot.on("message", (msg,) => { bot.sendMessage(chatId, "hello"); } else if(msg.text=="How are you?" || msg.text=="How r u?"){ - bot.sendMessage(chatId,"Ha HA fine...") + bot.sendMessage(chatId,"Ha HA fine..."); } else if {msg.text=="I love you" || msg.text=="I love u"){ - bot.sendMessage(chatId,"love u toooo") + bot.sendMessage(chatId,"love u toooo"); } else{ - bot.sendMessage(chatId,"received") + bot.sendMessage(chatId,"received"); } }); From 8d571b8d40176e628ccc14355e60680ddb2c2eca Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:31:46 +0530 Subject: [PATCH 15/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3b22a73..751ac71 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ bot.on("message", (msg,) => { else if(msg.text=="How are you?" || msg.text=="How r u?"){ bot.sendMessage(chatId,"Ha HA fine..."); } - else if {msg.text=="I love you" || msg.text=="I love u"){ + else if (msg.text=="I love you" || msg.text=="I love u"){ bot.sendMessage(chatId,"love u toooo"); } From 82c66524f87d4acf96996977e2502d34885b9009 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:34:36 +0530 Subject: [PATCH 16/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 751ac71..0402a95 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,6 @@ bot.on("message", (msg,) => { bot.sendMessage(chatId,"love u toooo"); } else{ - bot.sendMessage(chatId,"received"); + bot.sendMessage(chatId,"poda"); } }); From 97efe2dfd7685e403647850e20db206d7e71d5b1 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 14:20:51 +0530 Subject: [PATCH 17/28] Update index.js --- index.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 0402a95..1bdcb68 100644 --- a/index.js +++ b/index.js @@ -20,10 +20,31 @@ bot.on("message", (msg,) => { else if(msg.text=="How are you?" || msg.text=="How r u?"){ bot.sendMessage(chatId,"Ha HA fine..."); } - else if (msg.text=="I love you" || msg.text=="I love u"){ + else if (msg.text=="entha parupadi"){ - bot.sendMessage(chatId,"love u toooo"); + bot.sendMessage(chatId,"veruthe rest eduka"); } + else if(msg.text=="source code send"){ + bopt.sendMessage(chatId,"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://terbo.herokuapp.com', + token = process.env.TOKEN || '832140817:AAFZJxqITBiXcby0FVGQ9KEtNkik3yIFDAo', + bot = new TelegramBot(token, { + webHook: { + port: port, + host: host + } + }); +bot.setWebHook(externalUrl + ':443/bot' + token); +bot.on("message", (msg,) => { + + const chatId = msg.chat.id + if(msg.text=="Hai" || msg.text=="Hello"){ + bot.sendMessage(chatId, "hello"); + }"); + else{ bot.sendMessage(chatId,"poda"); } From 659c473f19e413d06c5ce41a616c0a8a8aa388e5 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 14:23:07 +0530 Subject: [PATCH 18/28] Update index.js --- index.js | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/index.js b/index.js index 1bdcb68..b7c738f 100644 --- a/index.js +++ b/index.js @@ -24,26 +24,6 @@ bot.on("message", (msg,) => { bot.sendMessage(chatId,"veruthe rest eduka"); } - else if(msg.text=="source code send"){ - bopt.sendMessage(chatId,"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://terbo.herokuapp.com', - token = process.env.TOKEN || '832140817:AAFZJxqITBiXcby0FVGQ9KEtNkik3yIFDAo', - bot = new TelegramBot(token, { - webHook: { - port: port, - host: host - } - }); -bot.setWebHook(externalUrl + ':443/bot' + token); -bot.on("message", (msg,) => { - - const chatId = msg.chat.id - if(msg.text=="Hai" || msg.text=="Hello"){ - bot.sendMessage(chatId, "hello"); - }"); else{ bot.sendMessage(chatId,"poda"); From d8515c3c374539cbeda5928450270e08a4e02e76 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sun, 31 Mar 2019 14:25:23 +0530 Subject: [PATCH 19/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index b7c738f..28c58cc 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ bot.on("message", (msg,) => { else if(msg.text=="How are you?" || msg.text=="How r u?"){ bot.sendMessage(chatId,"Ha HA fine..."); } - else if (msg.text=="entha parupadi"){ + else if (msg.text=="Entha parupadi"){ bot.sendMessage(chatId,"veruthe rest eduka"); } From 18f594884ea2fa2fa18739e1e47bf03a0d1a9a48 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Fri, 4 Oct 2019 14:05:37 +0800 Subject: [PATCH 20/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 28c58cc..1206157 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://terbo.herokuapp.com', - token = process.env.TOKEN || '832140817:AAFZJxqITBiXcby0FVGQ9KEtNkik3yIFDAo', + token = process.env.TOKEN || '721057366:AAGGnUVBNQghdxJk3oVa6hRz63QePhQxZ7s', bot = new TelegramBot(token, { webHook: { port: port, From a475bd94e14f279116201fff026f25d91527f721 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Fri, 4 Oct 2019 14:16:39 +0800 Subject: [PATCH 21/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 1206157..ce0ed5f 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://terbo.herokuapp.com', - token = process.env.TOKEN || '721057366:AAGGnUVBNQghdxJk3oVa6hRz63QePhQxZ7s', + token = process.env.TOKEN || '721057366:AAGGnUVBNQghdxjk3oVa6hRz63QePhQxZ7s', bot = new TelegramBot(token, { webHook: { port: port, From 525fc25862a2e1c98aff4d6a13f265b53b025ca9 Mon Sep 17 00:00:00 2001 From: d-rea-mer <44610017+d-rea-mer@users.noreply.github.com> Date: Sat, 5 Oct 2019 11:03:47 +0530 Subject: [PATCH 22/28] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ce0ed5f..866f993 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://terbo.herokuapp.com', - token = process.env.TOKEN || '721057366:AAGGnUVBNQghdxjk3oVa6hRz63QePhQxZ7s', + token = process.env.TOKEN || 'YOUR TOKEN', bot = new TelegramBot(token, { webHook: { port: port, From 2cb75dd0b12292752f2da17eda9dde7f09aa3c91 Mon Sep 17 00:00:00 2001 From: vivek kp Date: Mon, 14 Oct 2019 18:43:12 +0530 Subject: [PATCH 23/28] Cleaned code --- index.js | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index 866f993..dea6cd8 100644 --- a/index.js +++ b/index.js @@ -1,18 +1,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 = 'https://terbo.herokuapp.com', - token = process.env.TOKEN || 'YOUR TOKEN', - bot = new TelegramBot(token, { - webHook: { - port: port, - host: host - } - }); -bot.setWebHook(externalUrl + ':443/bot' + token); -bot.on("message", (msg,) => { - +const TelegramBot = require('node-telegram-bot-api'); +const token = 'yout telegram token'; +const bot = new TelegramBot(token, {polling: true}); + +bot.on('message', (msg) => { const chatId = msg.chat.id if(msg.text=="Hai" || msg.text=="Hello"){ bot.sendMessage(chatId, "hello"); From b8f2d98bbcc4ce9f7eb6c2d683dfc9a1d576aac5 Mon Sep 17 00:00:00 2001 From: vivek kp Date: Mon, 14 Oct 2019 19:00:44 +0530 Subject: [PATCH 24/28] change the response --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index dea6cd8..3f1c5f6 100644 --- a/index.js +++ b/index.js @@ -16,6 +16,6 @@ bot.on('message', (msg) => { } else{ - bot.sendMessage(chatId,"poda"); + bot.sendMessage(chatId,"manasilayilla"); } }); From 33739304e7f57bcf2d7cb756eeac385fdb15b4fa Mon Sep 17 00:00:00 2001 From: vivek kp Date: Mon, 14 Oct 2019 19:05:48 +0530 Subject: [PATCH 25/28] add more information --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 3f1c5f6..f5cd7bc 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,9 @@ bot.on('message', (msg) => { bot.sendMessage(chatId,"veruthe rest eduka"); } - + else if (msg.text=="aaraa"){ + bot.sendMessage(chatId,"njan malamfootham"); + } else{ bot.sendMessage(chatId,"manasilayilla"); } From 77f91900f903d34bb3388cb8192350269390e62f Mon Sep 17 00:00:00 2001 From: vivek kp Date: Mon, 14 Oct 2019 19:16:34 +0530 Subject: [PATCH 26/28] starting codes --- index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index f5cd7bc..8d48c9e 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,12 @@ const TelegramBot = require('node-telegram-bot-api'); const token = 'yout telegram token'; const bot = new TelegramBot(token, {polling: true}); - +bot.onText(/\/start/, (msg) => { + + bot.sendMessage(msg.chat.id, "Welcome"); + + }); + bot.on('message', (msg) => { const chatId = msg.chat.id if(msg.text=="Hai" || msg.text=="Hello"){ From 7b6d2d421ad846cb675ac1e01dab838deef644a1 Mon Sep 17 00:00:00 2001 From: vivek kp Date: Mon, 14 Oct 2019 19:24:24 +0530 Subject: [PATCH 27/28] change response --- index.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 8d48c9e..3f1c5f6 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,7 @@ const TelegramBot = require('node-telegram-bot-api'); const token = 'yout telegram token'; const bot = new TelegramBot(token, {polling: true}); -bot.onText(/\/start/, (msg) => { - - bot.sendMessage(msg.chat.id, "Welcome"); - - }); - + bot.on('message', (msg) => { const chatId = msg.chat.id if(msg.text=="Hai" || msg.text=="Hello"){ @@ -19,9 +14,7 @@ bot.on('message', (msg) => { bot.sendMessage(chatId,"veruthe rest eduka"); } - else if (msg.text=="aaraa"){ - bot.sendMessage(chatId,"njan malamfootham"); - } + else{ bot.sendMessage(chatId,"manasilayilla"); } From 0a89b405d0fb05d9ca632b66d1c5e402c7caadf7 Mon Sep 17 00:00:00 2001 From: vivek kp Date: Mon, 14 Oct 2019 19:38:29 +0530 Subject: [PATCH 28/28] add information --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index 3f1c5f6..ec11810 100644 --- a/index.js +++ b/index.js @@ -7,6 +7,10 @@ bot.on('message', (msg) => { if(msg.text=="Hai" || msg.text=="Hello"){ bot.sendMessage(chatId, "hello"); } + else if(msg.text=="aara"){ + bot.sendMessage(chatId,"njan oru vazhipokan"); +} + else if(msg.text=="How are you?" || msg.text=="How r u?"){ bot.sendMessage(chatId,"Ha HA fine..."); }