diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 0589123..4a6af09 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -59,8 +59,8 @@ protected function installScaffolding(): void ); $this->replaceInFile( - "'message' => [],", - "'message' => [],\n\n\t\t\t\t'message.photo' => [ + "'message' => [],", + "'message' => [],\n\n\t\t\t\t'message.photo' => [ \t\t\App\Listeners\ProcessInboundPhoto::class,\n\t\t\t\t],\n", config_path('telegram.php') ); diff --git a/stubs/app/Listeners/ProcessInboundPhoto.php b/stubs/app/Listeners/ProcessInboundPhoto.php index 3c90123..12d7a11 100644 --- a/stubs/app/Listeners/ProcessInboundPhoto.php +++ b/stubs/app/Listeners/ProcessInboundPhoto.php @@ -23,7 +23,7 @@ public function handle(UpdateEvent $event) // Download the largest image to the storage/app directory. $photo = collect($update['message']['photo'])->last(); - $bot->downloadFile($photo, storage_path('app/photos')); + $bot->downloadFile($photo['file_id'], storage_path('app/photos')); // Reply the user. $text = 'Thanks for uploading the pic!';