From 55357a1b0eb196dbc5d9b59778a65cea5605cc43 Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Fri, 17 Dec 2021 13:35:54 +0800 Subject: [PATCH] update: fix markdown parse --- app/Services/TelegramService.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/TelegramService.php b/app/Services/TelegramService.php index 92427c2b..50958909 100644 --- a/app/Services/TelegramService.php +++ b/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,