Skip to content

Instantly share code, notes, and snippets.

@hongthaiphi
Last active May 20, 2016
Embed
What would you like to do?
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