File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 7
7
// Telegram chat id
8
8
'chat_id ' => env ('TELEGRAM_LOGGER_CHAT_ID ' ),
9
9
10
+ // Telegram chat id
11
+ 'message_thread_id ' => env ('TELEGRAM_LOGGER_MESSAGE_THEAD_ID ' , null ),
12
+
10
13
// Blade Template to use formatting logs
11
14
'template ' => env ('TELEGRAM_LOGGER_TEMPLATE ' , 'laravel-telegram-logging::standard ' ),
12
15
Original file line number Diff line number Diff line change @@ -37,6 +37,13 @@ class TelegramHandler extends AbstractProcessingHandler
37
37
*/
38
38
private $ chatId ;
39
39
40
+ /**
41
+ * Message thread id for bot
42
+ *
43
+ * @var int|null
44
+ */
45
+ private $ messageThreadId ;
46
+
40
47
/**
41
48
* Application name
42
49
*
@@ -65,6 +72,7 @@ public function __construct(array $config)
65
72
$ this ->config = $ config ;
66
73
$ this ->botToken = $ this ->getConfigValue ('token ' );
67
74
$ this ->chatId = $ this ->getConfigValue ('chat_id ' );
75
+ $ this ->messageThreadId = $ this ->getConfigValue ('message_thread_id ' );
68
76
69
77
// define variables for text message
70
78
$ this ->appName = config ('app.name ' );
@@ -133,9 +141,10 @@ private function sendMessage(string $text): void
133
141
{
134
142
$ httpQuery = http_build_query (array_merge (
135
143
[
136
- 'text ' => $ text ,
137
- 'chat_id ' => $ this ->chatId ,
138
- 'parse_mode ' => 'html ' ,
144
+ 'text ' => $ text ,
145
+ 'chat_id ' => $ this ->chatId ,
146
+ 'message_thead_id ' => $ this ->messageThreadId ,
147
+ 'parse_mode ' => 'html ' ,
139
148
],
140
149
config ('telegram-logger.options ' , [])
141
150
));
You can’t perform that action at this time.
0 commit comments