Browse Source

update: fix markdown parse

tokumeikoi 3 years ago
parent
commit
55357a1b0e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/Services/TelegramService.php

+ 4 - 0
app/Services/TelegramService.php

@@ -4,6 +4,7 @@ namespace App\Services;
 use App\Jobs\SendTelegramJob;
 use App\Models\User;
 use \Curl\Curl;
+use Illuminate\Mail\Markdown;
 
 class TelegramService {
     protected $api;
@@ -15,6 +16,9 @@ class TelegramService {
 
     public function sendMessage(int $chatId, string $text, string $parseMode = '')
     {
+        if ($parseMode === 'markdown') {
+            $text = Markdown::parse($text);
+        }
         $this->request('sendMessage', [
             'chat_id' => $chatId,
             'text' => $text,