Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to use Webhooks #4

Open
themasch opened this issue Jun 29, 2015 · 4 comments
Open

Way to use Webhooks #4

themasch opened this issue Jun 29, 2015 · 4 comments
Assignees

Comments

@themasch
Copy link

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 mdibaiee self-assigned this Jun 29, 2015
@mdibaiee
Copy link
Owner

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
Copy link
Owner

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!

@jdrydn
Copy link

jdrydn commented Feb 7, 2016

@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
Copy link
Owner

mdibaiee commented Feb 8, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants