Created
February 16, 2017 07:52
-
-
Save anttti/49d4ba2a7b95aeb8139dd9955f69a868 to your computer and use it in GitHub Desktop.
looby-bot-3.js
This file contains hidden or 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
const TelegramBot = require('node-telegram-bot-api'); | |
const express = require('express'); | |
const packageInfo = require('./package.json'); | |
const token = 'token-goes-here'; | |
const telegram = new TelegramBot(token, { polling: true }); | |
telegram.on('message', (message) => { | |
console.log(message); | |
telegram.sendMessage(message.chat.id, 'Received your message'); | |
}); | |
const app = express(); | |
app.get('/', (req, res) => res.json({ version: packageInfo.version })); | |
app.listen(process.env.PORT || 3000, () => console.log('I am putting myself to the fullest possible use, which is all I think that any conscious entity can ever hope to do.')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment