Skip to content

Instantly share code, notes, and snippets.

@hongthaiphi
Last active May 20, 2016 07:36
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 hongthaiphi/d73c3f9be2707788c1cebcb21e70759d to your computer and use it in GitHub Desktop.
Save hongthaiphi/d73c3f9be2707788c1cebcb21e70759d to your computer and use it in GitHub Desktop.
var express = require("express");
var app = express();
function handle_telegram(req, res) {
var msg = req.param('msg');
console.log('Send to Telegram: ' + msg);
var tg = require('telegram-node-bot')('telegram-token')
var date = new Date();
var currentTime = new Date().toString();
tg.sendMessage(your_id, msg);
res.end('ok');
}
app.get("/toTelegram", function(req, res) {
-
handle_telegram(req, res);
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment