Skip to content

Commit 552b53e

Browse files
committed
feat(finish): finish log system
1 parent 9dc0bfe commit 552b53e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/Jobs/SendTelegram.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use GuzzleHttp\Client;
66
use Illuminate\Contracts\Queue\ShouldQueue;
77
use Illuminate\Foundation\Queue\Queueable;
8+
use Illuminate\Support\Facades\Log;
89

910
class SendTelegram implements ShouldQueue
1011
{
@@ -29,6 +30,10 @@ public function handle(): void
2930
$client = new Client();
3031
$url = "https://api.telegram.org/bot{$token}/sendMessage";
3132

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+
}
3338
}
3439
}

0 commit comments

Comments
 (0)