Skip to content

Commit 8a985c8

Browse files
authored
Merge pull request #1462 from povargek/patch-1
fix replyToChat
2 parents 0a124a2 + ef1165f commit 8a985c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Commands/Command.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -418,10 +418,16 @@ protected function removeNonPrivateMessage(): bool
418418
public function replyToChat(string $text, array $data = []): ServerResponse
419419
{
420420
if ($message = $this->getMessage() ?: $this->getEditedMessage() ?: $this->getChannelPost() ?: $this->getEditedChannelPost()) {
421-
return Request::sendMessage(array_merge([
421+
$reply = [
422422
'chat_id' => $message->getChat()->getId(),
423423
'text' => $text,
424-
], $data));
424+
];
425+
426+
if ($message->getIsTopicMessage()) {
427+
$reply['message_thread_id'] = $message->getMessageThreadId();
428+
}
429+
430+
return Request::sendMessage(array_merge($reply, $data));
425431
}
426432

427433
return Request::emptyResponse();

0 commit comments

Comments
 (0)