-
-
Save hongthaiphi/d73c3f9be2707788c1cebcb21e70759d to your computer and use it in GitHub Desktop.
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
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