telegram-rs / telegram-bot

Rust Library for creating a Telegram Bot
MIT License
939 stars 156 forks source link

HTTPS Server listening for updates via setWebhook #1

Open LukasKalbertodt opened 9 years ago

LukasKalbertodt commented 9 years ago

I just added the method set_webhook on the dev branch. However, I wasn't able to provide a listen method that works similar to long_pull, but uses the webhook to acquire updates.

There are several problems that stop me from implementing listen, but mainly I didn't do it for this reason: I can't test it. Telegram sends updates via HTTPS only and does NOT accept self signed certs. Maybe this will change in the future, but right now I don't have time to get one and test more http stuff.

Just use long_pull for now.

rockneurotiko commented 9 years ago

You can use the openshift free plan to use the webhook, I'm using it and the SSL is handled automatically. https://hub.openshift.com/quickstarts/150-rust

When I have time I'll test this library to learn Rust for sure :smile:

LukasKalbertodt commented 9 years ago

I'm not sure if you misunderstood me or the other way around ;)

I am talking about the Telegram-API method setWebhook. A bot can listen as a https server and receive updates on that way. This has nothing to do with git or anything...

rockneurotiko commented 9 years ago

Yeah, but you said: "but mainly I didn't do it for this reason: I can't test it." With openshift you (or other) can test it free ;-)

LukasKalbertodt commented 9 years ago

Oh now I get, what you're saying. But I don't really want to push every time I want to test it. But I consider doing this the next time I can spare some time for this project ...

rockneurotiko commented 9 years ago

Nice!

Just as a side note, to test in openshift you don't push to the main repo, you push to a git created for the "gear" deployed.

TheReverend403 commented 8 years ago

Not sure of the status of this feature right now, but Telegram recently added support for self-signed certs. https://core.telegram.org/bots/self-signed

LukasKalbertodt commented 8 years ago

Sweet, thanks for the bump! Will look into it sometime soon, I think.

bjorn3 commented 7 years ago

Lets encrypt allows you to automatically create certificates for your own domains.