Skip to content

Commit

Permalink
Merge pull request #1296 from php-telegram-bot/custom-api-uri
Browse files Browse the repository at this point in the history
Make sure setCustomBotApiUri has an effect if Telegram object was already instantiated.
  • Loading branch information
TiiFuchs authored May 28, 2024
2 parents c3e099e + dece5d2 commit e86aca6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,10 @@ public static function setClient(ClientInterface $client): void
*/
public static function setCustomBotApiUri(string $api_base_uri, string $api_base_download_uri = ''): void
{
if (self::$client) {
throw new TelegramException('setCustomBotApiUri() needs to be called before the Telegram object gets instantiated.');
}

self::$api_base_uri = $api_base_uri;
if ($api_base_download_uri !== '') {
self::$api_base_download_uri = $api_base_download_uri;
Expand Down

0 comments on commit e86aca6

Please sign in to comment.