Skip to content

Commit

Permalink
Merge pull request #36 from saber13812002/parse_mode_HTML
Browse files Browse the repository at this point in the history
Parse mode html
  • Loading branch information
saber13812002 authored Sep 28, 2023
2 parents 0411b5e + d3d4f0d commit c90bb94
Show file tree
Hide file tree
Showing 14 changed files with 458 additions and 108 deletions.
19 changes: 13 additions & 6 deletions app/Helpers/BotHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ public static function sendKeyboardMessage(Telegram $messenger, string $message,
$content = [
'chat_id' => $chat_id,
'text' => $message,
'reply_markup' => $keyboard
'reply_markup' => $keyboard,
'parse_mode' => "html"
];

$messenger->sendMessage($content);
Expand All @@ -184,7 +185,8 @@ public static function sendKeyboardMessageToChatId(Telegram $messenger, string $
$content = [
'chat_id' => $chat_id,
'text' => $message,
'reply_markup' => $keyboard
'reply_markup' => $keyboard,
'parse_mode' => "html"
];

$messenger->sendMessage($content);
Expand All @@ -202,7 +204,8 @@ public static function sendMessage($messenger, string $message): void

$content = [
'chat_id' => $chat_id,
'text' => $message
'text' => $message,
'parse_mode' => "html"
];

$messenger->sendMessage($content);
Expand All @@ -220,7 +223,7 @@ public static function sendMessageParseMode($messenger, string $message): void
$content = [
'chat_id' => $chat_id,
'text' => $message,
'parse_mode' => "HTML"
'parse_mode' => "html"
];

$messenger->sendMessage($content);
Expand Down Expand Up @@ -254,7 +257,8 @@ public static function sendMessageByChatId($messenger, $chat_id, string $message
{
$content = [
'chat_id' => $chat_id,
'text' => $message
'text' => $message,
'parse_mode' => "html"
];

$messenger->sendMessage($content);
Expand Down Expand Up @@ -668,6 +672,7 @@ static function messageWithKeyboard($botToken, $chatId, string $message, $inline
$response = $client->post($uri, ['json' => [
"chat_id" => $chatId,
"text" => $message,
'parse_mode' => "html",
"reply_markup" => [
"inline_keyboard" => $inlineKeyboard
]]]);
Expand All @@ -685,11 +690,13 @@ static function messageWithKeyboard($botToken, $chatId, string $message, $inline
*/
public static function sendPhoto(mixed $chat_id, string $photoUrl, string $title, Telegram $messenger, string $caption = ""): mixed
{

$content = [
'chat_id' => $chat_id,
'photo' => $photoUrl,
'title' => $title,
'caption' => $caption
'caption' => $caption,
'parse_mode' => "HTML"
];

return $messenger->sendPhoto($content);
Expand Down
Loading

0 comments on commit c90bb94

Please sign in to comment.