We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ea8cf24 + 2762f3c commit bc076e0Copy full SHA for bc076e0
src/Request.php
@@ -316,8 +316,13 @@ public static function send($action, array $data = null)
316
return new ServerResponse($fake_response, $bot_name);
317
}
318
319
- $response = self::executeCurl($action, $data);
320
- return new ServerResponse(json_decode($response, true), $bot_name);
+ $response = json_decode(self::executeCurl($action, $data), true);
+
321
+ if (is_null($response)) {
322
+ throw new TelegramException('Telegram returned an invalid response! Please your bot name and api token.');
323
+ }
324
325
+ return new ServerResponse($response, $bot_name);
326
327
328
/**
0 commit comments