From c945de23dfd1b820c9c330148a9f4445df8e1fa4 Mon Sep 17 00:00:00 2001 From: manshahi Date: Thu, 25 May 2017 20:22:11 +0430 Subject: [PATCH] Update server.js --- server.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/server.js b/server.js index 5619d5c..8b13789 100644 --- a/server.js +++ b/server.js @@ -1,20 +1 @@ -var TelegramBot = require('node-telegram-bot-api'); -var token = 'YOUR_TELEGRAM_BOT_TOKEN'; -// Setup polling way -var bot = new TelegramBot(token, {polling: true}); - -// Matches /echo [whatever] -bot.onText(/\/echo (.+)/, function (msg, match) { - var fromId = msg.from.id; - var resp = match[1]; - bot.sendMessage(fromId, resp); -}); - -// Any kind of message -bot.on('message', function (msg) { - var chatId = msg.chat.id; - // photo can be: a file path, a stream or a Telegram file_id - var photo = 'cats.png'; - bot.sendPhoto(chatId, photo, {caption: 'Lovely kittens'}); -});