Way to use Webhooks #4

Open
opened 2015-06-29 12:15:45 +00:00 by themasch · 4 comments
themasch commented 2015-06-29 12:15:45 +00:00 (Migrated from github.com)

Currently this API uses polling for updates (i guess).
It would be nice if you could configure it to not poll for updates and offer a method to input messages received by webhooks.

This way the user could fire up a express/koa/hapi server and feed the payload from webhookts to the bot.

Would that be clever?

Currently this API uses polling for updates (i guess). It would be nice if you could configure it to not poll for updates and offer a method to input messages received by webhooks. This way the user could fire up a express/koa/hapi server and feed the payload from webhookts to the bot. Would that be clever?
mdibaiee commented 2015-06-29 19:23:25 +00:00 (Migrated from github.com)

Hi, that is planned, I'm going to implement it in the coming days, if you want to contribute, I accept pull requests.

Thanks!

Hi, that is planned, I'm going to implement it in the coming days, if you want to contribute, I accept pull requests. Thanks!
mdibaiee commented 2015-06-29 22:23:30 +00:00 (Migrated from github.com)

Hey @themasch, I just pushed a commit which adds support for webhooks, but as I don't have an HTTPS certification or any experience using HTTPS, I'm not sure if it will work with HTTPS connections. b55fb3c

I tested it with HTTP and it was OK, can you please test this and give feedback? Also if you manage to get it running, please give me your code so I can add it to our examples.

To use webhooks:

bot.start({
  url: 'YOUR_HTTPS_URL', // this is sent to Telegram API's setWebhook, telegram will send requests to this URL
  server: { // This object is passed to https.createServer
    key: 'something'
  }
});

Thanks!

Hey @themasch, I just pushed a commit which adds support for webhooks, but as I don't have an HTTPS certification or any experience using HTTPS, I'm not sure if it will work with HTTPS connections. b55fb3c I tested it with HTTP and it was OK, can you please test this and give feedback? Also if you manage to get it running, please give me your code so I can add it to our examples. To use webhooks: ``` javascript bot.start({ url: 'YOUR_HTTPS_URL', // this is sent to Telegram API's setWebhook, telegram will send requests to this URL server: { // This object is passed to https.createServer key: 'something' } }); ``` Thanks!
jdrydn commented 2016-02-07 22:53:07 +00:00 (Migrated from github.com)

@mdibaiee You could use https://ngrok.com or https://letsencrypt.org if you're looking for SSL - I'm currently using letsencrypt for my personal dedi with a Telegram API endpoint, over SSL, and letsencrypt has meant I don't have to send a SSL certification to Telegram's setWebhook either! 😉

@mdibaiee You could use https://ngrok.com or https://letsencrypt.org if you're looking for SSL - I'm currently using **letsencrypt** for my personal dedi with a Telegram API endpoint, over SSL, and **letsencrypt** has meant I don't have to send a SSL certification to Telegram's `setWebhook` either! :wink:
mdibaiee commented 2016-02-08 05:11:24 +00:00 (Migrated from github.com)

@jdrydn You're right! Thank you for mentioning this! 👍

@jdrydn You're right! Thank you for mentioning this! :+1:
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: thereadme/node-telegram-api#4
No description provided.