Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.get('/hook', function (req, res) {
- url='https://api.telegram.org/bot17xxxxx/setwebhook?url=https://example.com/hook'
- request(url, function (error, response, body) {
- if (!error && response.statusCode == 200) {
- console.log(body)
- }
- response.emit('close');
- });
- });
- {"ok":true,"result":true,"description":"Webhook was set"}
- app.post("/hook", function(req, res) {
- console.log(body);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement