Skip to content

Commit dece5d2

Browse files
committed
Changed to an exception so it is at least understandable why it's not working.
1 parent 54bc8a3 commit dece5d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Request.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,14 @@ public static function setClient(ClientInterface $client): void
323323
*/
324324
public static function setCustomBotApiUri(string $api_base_uri, string $api_base_download_uri = ''): void
325325
{
326+
if (self::$client) {
327+
throw new TelegramException('setCustomBotApiUri() needs to be called before the Telegram object gets instantiated.');
328+
}
329+
326330
self::$api_base_uri = $api_base_uri;
327331
if ($api_base_download_uri !== '') {
328332
self::$api_base_download_uri = $api_base_download_uri;
329333
}
330-
331-
if (self::$telegram) {
332-
self::initialize(self::$telegram);
333-
}
334334
}
335335

336336
/**

0 commit comments

Comments
 (0)