@@ -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
*
@@ -62,9 +69,10 @@ public function __construct(array $config)
62
69
parent ::__construct ($ level , true );
63
70
64
71
// define variables for making Telegram request
65
- $ this ->config = $ config ;
66
- $ this ->botToken = $ this ->getConfigValue ('token ' );
67
- $ this ->chatId = $ this ->getConfigValue ('chat_id ' );
72
+ $ this ->config = $ config ;
73
+ $ this ->botToken = $ this ->getConfigValue ('token ' );
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_thread_id ' => $ this ->messageThreadId ,
147
+ 'parse_mode ' => 'html ' ,
139
148
],
140
149
config ('telegram-logger.options ' , [])
141
150
));
0 commit comments