Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. app.get('/hook', function (req, res) {
  2.  
  3. url='https://api.telegram.org/bot17xxxxx/setwebhook?url=https://example.com/hook'
  4. request(url, function (error, response, body) {
  5. if (!error && response.statusCode == 200) {
  6. console.log(body)
  7. }
  8. response.emit('close');
  9. });
  10. });
  11.  
  12. {"ok":true,"result":true,"description":"Webhook was set"}
  13.  
  14. app.post("/hook", function(req, res) {
  15. console.log(body);
  16.  
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement