-
-
Notifications
You must be signed in to change notification settings - Fork 963
change $api_base_uri in order to use Request class with my own server url(tdlib) #1295
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
Comments
As you can see the setCustomBotApiUrl method does exactly the same as setting the variable: Lines 324 to 330 in 72528b7
But the Request::initialize method copies the base_uri from the static property into a Client object. Lines 302 to 306 in 3cf50e7
This initialize() method gets called in the constructor of the Telegram class... So I think you need to call Request::setCustomBotApiUri BEFORE you instantiate a new Telegram class.
I made a note for myself to take a look into that, so we may loose that requirement or streamline it a bit more. Does this solve your problem? |
Yes. problem solved. |
Uh oh!
There was an error while loading. Please reload this page.
🐞 Bug Report
When I use
\Longman\TelegramBot\Request::setCustomBotApiUri(
$api_base_uri = 'http://myownserver:8081', // Default: https://api.telegram.org
);
and then use \Longman\TelegramBot\Request::sendAudio it still use https://api.telegram.org as base api url.
but when I change 'private static $api_base_uri = 'http://myownserver:8081';' in request.php manually it works!
Required Information
| Operating system | Centos 8
| PHP Telegram Bot version | latest
| PHP version | 7.4
| MySQL version | none
| Update Method | Webhook
| Self-signed certificate | not sure/use it on my own server
Expected behaviour
When using \Longman\TelegramBot\Request::setCustomBotApiUri(
$api_base_uri = 'http://myownserver:8081', // Default: https://api.telegram.org
);
for all of the usage of Request:: in that page it should use http://myownserver:8081 as base api telegram url.
The text was updated successfully, but these errors were encountered: