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

Make sure setCustomBotApiUri has an effect if Telegram object was already instantiated. #1296

Merged
merged 2 commits into from
May 28, 2024

Conversation

TiiFuchs
Copy link
Member

Should fix problems like #1295

@TiiFuchs TiiFuchs requested a review from noplanman March 18, 2022 08:38
@TiiFuchs TiiFuchs self-assigned this Mar 18, 2022
@TiiFuchs
Copy link
Member Author

@noplanman What do you think?

@TiiFuchs
Copy link
Member Author

We have a few difficulties with finding the right way here, because you also can set a Guzzle Client yourself with Request::setClient() and this should always take precedence over custom settings, like the base_uri we're setting in setCustomBotApiUri().

For now I added a check that looks, if there is already a client and throws an TelegramException, so we get an Exception if we set the custom Bot API URI after instantiating the Telegram class with an understandable error that helps solve the problem directly.

If you use your own Guzzle Client, you need to set the base_uri accordingly yourself!

@TiiFuchs TiiFuchs merged commit e86aca6 into develop May 28, 2024
@TiiFuchs TiiFuchs deleted the custom-api-uri branch May 28, 2024 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant