Skip to content

Commit e86aca6

Browse files
authored
Merge pull request #1296 from php-telegram-bot/custom-api-uri
Make sure setCustomBotApiUri has an effect if Telegram object was already instantiated.
2 parents c3e099e + dece5d2 commit e86aca6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Request.php

+4
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ public static function setClient(ClientInterface $client): void
410410
*/
411411
public static function setCustomBotApiUri(string $api_base_uri, string $api_base_download_uri = ''): void
412412
{
413+
if (self::$client) {
414+
throw new TelegramException('setCustomBotApiUri() needs to be called before the Telegram object gets instantiated.');
415+
}
416+
413417
self::$api_base_uri = $api_base_uri;
414418
if ($api_base_download_uri !== '') {
415419
self::$api_base_download_uri = $api_base_download_uri;

0 commit comments

Comments
 (0)