irazasyed/telegram-bot-sdk

[Bug]: HTTP webhooks are prohibited, but they are allowed in case of using own bot api server

glukinho opened this issue · 0 comments

PHP version

8.3.10

irazasyed/telegram-bot-sdk version

v3.14.0

Laravel version (if any)

v11.21.0

Code To Reproduce the bug

I'm using Laravel
base_bot_url in telegram.php set to: 'http://127.0.0.1:8081/bot' because I'm using my own bot API server launched on the same host.

I execute in Tinker:

$webhook_url = 'http://127.0.0.1/api/telegram/my_bot/webhook';
Telegram::bot('my_bot')->setWebhook(['url' => $webhook_url]);

This code gives: Telegram\Bot\Exceptions\TelegramSDKException Invalid URL, should be a HTTPS url.
If I manually set webhook to URL http://127.0.0.1/api/telegram/my_bot/webhook using Telegram Bot API (with CURL for example), everything works fine.
I think HTTP webhooks shouldn't be prohibited because they definitely may exist in Telegram.

Error stacktrace (if any)

No response