Last active
October 1, 2017 18:15
-
-
Save fernyettheplant/7abf6997b0c6d8f618d3e4e820e89193 to your computer and use it in GitHub Desktop.
Example of a telegram bot responding anything using webtasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = (context, cb) => { | |
const TelegramBot = require('node-telegram-bot-api'); | |
const token = "YOUR_API_TOKEN"; | |
const bot = new TelegramBot(token); | |
const chatId = context.body.message.chat.id; | |
const out = bot.sendMessage(chatId, 'Hello World!'); | |
return cb(null, out); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment