mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update: fix markdown parse
This commit is contained in:
parent
0f777f1a77
commit
55357a1b0e
@ -4,6 +4,7 @@ namespace App\Services;
|
|||||||
use App\Jobs\SendTelegramJob;
|
use App\Jobs\SendTelegramJob;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use \Curl\Curl;
|
use \Curl\Curl;
|
||||||
|
use Illuminate\Mail\Markdown;
|
||||||
|
|
||||||
class TelegramService {
|
class TelegramService {
|
||||||
protected $api;
|
protected $api;
|
||||||
@ -15,6 +16,9 @@ class TelegramService {
|
|||||||
|
|
||||||
public function sendMessage(int $chatId, string $text, string $parseMode = '')
|
public function sendMessage(int $chatId, string $text, string $parseMode = '')
|
||||||
{
|
{
|
||||||
|
if ($parseMode === 'markdown') {
|
||||||
|
$text = Markdown::parse($text);
|
||||||
|
}
|
||||||
$this->request('sendMessage', [
|
$this->request('sendMessage', [
|
||||||
'chat_id' => $chatId,
|
'chat_id' => $chatId,
|
||||||
'text' => $text,
|
'text' => $text,
|
||||||
|
Loading…
Reference in New Issue
Block a user