From a55f1cb6b7222b08666b30274fc6dec5ff9409fb Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:35:09 +0530 Subject: [PATCH 1/8] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 34fa95f..fbc5b21 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://pikachu-1.herokuapp.com", + token = process.env.TOKEN || '840524827:AAFrTvc5ifZ2re6NdIwrMNUrrtLaGjEeS8A', bot = new TelegramBot(token, { webHook: { port: port, From 3c85f7c489476e9a78b51495e09c78233316a003 Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 11:54:32 +0530 Subject: [PATCH 2/8] Update index.js --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index fbc5b21..4447470 100644 --- a/index.js +++ b/index.js @@ -11,3 +11,9 @@ const port = process.env.PORT || 443, } }); bot.setWebHook(externalUrl + ':443/bot' + token); + +bot.on('message', (msg) => { + const chatId = msg.chat.id; + console.log(msg.chat["text"]) + bot.sendMessage(chatId, 'pikka pe') +}) From 83b15488076a977e6f6ea4e893b521a82452f0a8 Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:02:28 +0530 Subject: [PATCH 3/8] Update index.js --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 4447470..366a791 100644 --- a/index.js +++ b/index.js @@ -14,6 +14,9 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on('message', (msg) => { const chatId = msg.chat.id; - console.log(msg.chat["text"]) + if(msg.text=="hi"){ + bot.sendMessage(chatId,'hello')} + if(msg.text == "hello"){ + bot.sendMessage(chatId,'hi')} bot.sendMessage(chatId, 'pikka pe') }) From d9d6bd33fa615248e4845439dadcf5bfdffb41b7 Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:11:04 +0530 Subject: [PATCH 4/8] Update index.js --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 366a791..eb11478 100644 --- a/index.js +++ b/index.js @@ -14,9 +14,10 @@ bot.setWebHook(externalUrl + ':443/bot' + token); bot.on('message', (msg) => { const chatId = msg.chat.id; - if(msg.text=="hi"){ + if(msg.text=="hi" ||msg.text == "Hi" ||msg.text =="HI" ){ bot.sendMessage(chatId,'hello')} - if(msg.text == "hello"){ + if(msg.text == "hello"||msg.text == "Hello" || msg.text=="HELLO"){ bot.sendMessage(chatId,'hi')} - bot.sendMessage(chatId, 'pikka pe') + else{ + bot.sendMessage(chatId, 'pikka pe')} }) From 340046a2e9990b611a3d38d9dbb3270367b076ee Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:35:14 +0530 Subject: [PATCH 5/8] Update index.js --- index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index eb11478..3a9877f 100644 --- a/index.js +++ b/index.js @@ -16,8 +16,13 @@ bot.on('message', (msg) => { const chatId = msg.chat.id; if(msg.text=="hi" ||msg.text == "Hi" ||msg.text =="HI" ){ bot.sendMessage(chatId,'hello')} - if(msg.text == "hello"||msg.text == "Hello" || msg.text=="HELLO"){ + else if(msg.text == "hello"||msg.text == "Hello" || msg.text=="HELLO"){ bot.sendMessage(chatId,'hi')} else{ - bot.sendMessage(chatId, 'pikka pe')} + bot.sendMessage(chatId, spam)} }) + +let spam = () => { + for(let i=0;i>0;i++){ + bot.sendMessage(chatId,'??????')}} + From 5c08788eb73c487b0ec201ca922cba02053adfef Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:48:59 +0530 Subject: [PATCH 6/8] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3a9877f..e29f49d 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ bot.on('message', (msg) => { else if(msg.text == "hello"||msg.text == "Hello" || msg.text=="HELLO"){ bot.sendMessage(chatId,'hi')} else{ - bot.sendMessage(chatId, spam)} + bot.sendMessage(chatId, spam())} }) let spam = () => { From db0258c6f8fa606f23ab06b1b65ea31d6b93b762 Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:52:44 +0530 Subject: [PATCH 7/8] Update index.js --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index e29f49d..5684539 100644 --- a/index.js +++ b/index.js @@ -19,10 +19,10 @@ bot.on('message', (msg) => { else if(msg.text == "hello"||msg.text == "Hello" || msg.text=="HELLO"){ bot.sendMessage(chatId,'hi')} else{ - bot.sendMessage(chatId, spam())} + bot.sendMessage(chatId, spam)} }) let spam = () => { - for(let i=0;i>0;i++){ + for(let i=0;i<1000000;i++){ bot.sendMessage(chatId,'??????')}} From f80470e131be20c2a22821b4c09b1930a5f5065e Mon Sep 17 00:00:00 2001 From: Govind Kartha <44610432+govkartha@users.noreply.github.com> Date: Sun, 31 Mar 2019 12:55:02 +0530 Subject: [PATCH 8/8] Update index.js --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 5684539..cd1a662 100644 --- a/index.js +++ b/index.js @@ -19,7 +19,7 @@ bot.on('message', (msg) => { else if(msg.text == "hello"||msg.text == "Hello" || msg.text=="HELLO"){ bot.sendMessage(chatId,'hi')} else{ - bot.sendMessage(chatId, spam)} + spam()} }) let spam = () => {