File tree Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Expand file tree Collapse file tree 2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 8
8
'chat_id ' => env ('TELEGRAM_LOGGER_CHAT_ID ' ),
9
9
10
10
// Blade Template to use formatting logs
11
- 'template ' => env ('TELEGRAM_LOGGER_TEMPLATE ' , 'laravel-telegram-logging::standard ' )
12
- ];
11
+ 'template ' => env ('TELEGRAM_LOGGER_TEMPLATE ' , 'laravel-telegram-logging::standard ' ),
12
+
13
+ // Telegram sendMessage options: https://core.telegram.org/bots/api#sendmessage
14
+ 'options ' => [
15
+ // 'parse_mode' => 'html',
16
+ // 'disable_web_page_preview' => true,
17
+ // 'disable_notification' => false
18
+ ]
19
+ ];
Original file line number Diff line number Diff line change @@ -120,11 +120,14 @@ private function formatText(array $record): string
120
120
*/
121
121
private function sendMessage (string $ text ): void
122
122
{
123
- $ httpQuery = http_build_query ([
124
- 'text ' => $ text ,
125
- 'chat_id ' => $ this ->chatId ,
126
- 'parse_mode ' => 'html ' ,
127
- ]);
123
+ $ httpQuery = http_build_query (array_merge (
124
+ [
125
+ 'text ' => $ text ,
126
+ 'chat_id ' => $ this ->chatId ,
127
+ 'parse_mode ' => 'html ' ,
128
+ ],
129
+ config ('telegram-logger.template ' , [])
130
+ ));
128
131
129
132
file_get_contents ('https://api.telegram.org/bot ' .$ this ->botToken .'/sendMessage? ' . $ httpQuery );
130
133
}
You can’t perform that action at this time.
0 commit comments