Skip to content

Instantly share code, notes, and snippets.

@anttti
Created February 16, 2017 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anttti/49d4ba2a7b95aeb8139dd9955f69a868 to your computer and use it in GitHub Desktop.
Save anttti/49d4ba2a7b95aeb8139dd9955f69a868 to your computer and use it in GitHub Desktop.
looby-bot-3.js
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