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'}); -});