Permalink
Browse files

minor fixes

  • Loading branch information...
david p
david p committed Feb 17, 2016
1 parent d33e017 commit a3f0748f0eabc489bbd09a10e53c9a8f88304583
@@ -266,12 +266,12 @@ private function getAvatar($tg)
return null;
$file = $response['photos'][0][1];
if(!array_key_exists('file_path'), $file) {
if(!array_key_exists('file_path', $file)) {
$json = file_get_contents('https://api.telegram.org/bot'.env('BOT_TOKEN').'/getFile?file_id='.$file['file_id']);
$response = json_decode($json, true)['result'];
$file = $response;
}
if(!array_key_exists('file_path'), $file) {
if(!array_key_exists('file_path', $file)) {
return null;
}
@@ -32,12 +32,12 @@ public function up()
if(array_key_exists('photos', $response) && count($response['photos']) > 0) {
$file = $response['photos'][0][1];
if(!array_key_exists('file_path'), $file) {
if(!array_key_exists('file_path', $file)) {
$json = file_get_contents('https://api.telegram.org/bot'.env('BOT_TOKEN').'/getFile?file_id='.$file['file_id']);
$response = json_decode($json, true)['result'];
$file = $response;
}
if(!array_key_exists('file_path'), $file) {
if(!array_key_exists('file_path', $file)) {
throw new \Exception();
}

0 comments on commit a3f0748

Please sign in to comment.