telegram-bot-ruby
telegram-bot-ruby copied to clipboard
set_webhook with certificate param
If use self-signed certificate and try to set web hook with following code:
bot.api.set_webhook url: hook_url, certificate: File.open('telegram.pem') Things do not work. It doesn't upload certificate.
It is said here that certificate should be instance of InputFile.
It seems the gem doesn't support this type right now.
@atipugin what do you think about that? Can I submit PR to support InputFile type?
It's also said
Provide Telegram with an HTTP URL for the file to be sent.
So maybe you can upload telegram.pem some where on your server and make it public available.
Then specify it's URL.
Such method of setting webhook I took from here https://github.com/solyaris/BOTServer/blob/master/lib/webhook.rb#L48
I found solution:
curl -F "url=https://<HOSTNAME>/webhooks/telegram" -F "certificate=@<FULL_PATH_TO_CERT.pem" https://api.telegram.org/bot<BOT_TOKEN>/setWebhook
So I wonder if it's possible to set webhook via this gem.
You can use certificate: Faraday::UploadIO.new('/path/to/cert') param for set_webhook method (see here: https://core.telegram.org/bots/api#setwebhook).
and see also Telegram Platfporm Bot API 2.3.1 Marvin's Marvellous Guide to All Things Webhook
BTW, Thanks Alexander for your gem!
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.
please take open the issue
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.