diff --git a/config/telegram-logger.php b/config/telegram-logger.php index 0ae7a23..4248ada 100644 --- a/config/telegram-logger.php +++ b/config/telegram-logger.php @@ -8,5 +8,12 @@ 'chat_id' => env('TELEGRAM_LOGGER_CHAT_ID'), // Blade Template to use formatting logs - 'template' => env('TELEGRAM_LOGGER_TEMPLATE', 'laravel-telegram-logging::standard') -]; \ No newline at end of file + 'template' => env('TELEGRAM_LOGGER_TEMPLATE', 'laravel-telegram-logging::standard'), + + // Telegram sendMessage options: https://core.telegram.org/bots/api#sendmessage + 'options' => [ + // 'parse_mode' => 'html', + // 'disable_web_page_preview' => true, + // 'disable_notification' => false + ] +]; diff --git a/src/TelegramHandler.php b/src/TelegramHandler.php index 9c67599..198deac 100644 --- a/src/TelegramHandler.php +++ b/src/TelegramHandler.php @@ -120,11 +120,14 @@ private function formatText(array $record): string */ private function sendMessage(string $text): void { - $httpQuery = http_build_query([ - 'text' => $text, - 'chat_id' => $this->chatId, - 'parse_mode' => 'html', - ]); + $httpQuery = http_build_query(array_merge( + [ + 'text' => $text, + 'chat_id' => $this->chatId, + 'parse_mode' => 'html', + ], + config('telegram-logger.options', []) + )); file_get_contents('https://api.telegram.org/bot'.$this->botToken.'/sendMessage?' . $httpQuery); }