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.
1 parent 9dc0bfe commit 552b53eCopy full SHA for 552b53e
app/Jobs/SendTelegram.php
@@ -5,6 +5,7 @@
5
use GuzzleHttp\Client;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Foundation\Queue\Queueable;
8
+use Illuminate\Support\Facades\Log;
9
10
class SendTelegram implements ShouldQueue
11
{
@@ -29,6 +30,10 @@ public function handle(): void
29
30
$client = new Client();
31
$url = "https://api.telegram.org/bot{$token}/sendMessage";
32
- $client->post($url, ['form_params' => ['chat_id' => $channelUsername, 'text' => $this->message]]);
33
+ try {
34
+ $client->post($url, ['form_params' => ['chat_id' => $channelUsername, 'text' => $this->message]]);
35
+ }catch (\Exception $e){
36
+ Log::error($e->getMessage());
37
+ }
38
}
39
0 commit comments