# Method: messages.getReplies

Back to methods index

Get messages in a reply thread

# Parameters:

Name Type Description Required
peer Username, chat ID, Update, Message or InputPeer Peer Optional
msg_id int Message ID Yes
offset_id int Offsets for pagination, for more info click here Yes
offset_date int Offsets for pagination, for more info click here Yes
add_offset int Offsets for pagination, for more info click here Yes
limit int Maximum number of results to return, see pagination Yes
max_id int If a positive value was transferred, the method will return only messages with ID smaller than max_id Yes
min_id int If a positive value was transferred, the method will return only messages with ID bigger than min_id Yes
hash Array of int Hash for pagination, for more info click here Optional

# Return type: messages.Messages

# Can bots use this method: YES

# MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();

$messages_Messages = $MadelineProto->messages->getReplies(['peer' => InputPeer, 'msg_id' => int, 'offset_id' => int, 'offset_date' => int, 'add_offset' => int, 'limit' => int, 'max_id' => int, 'min_id' => int, 'hash' => [int, int], ]);

Or, if you’re into Lua:

messages_Messages = messages.getReplies({peer=InputPeer, msg_id=int, offset_id=int, offset_date=int, add_offset=int, limit=int, max_id=int, min_id=int, hash={int}, })

# Errors

Code Type Description
400 MSG_ID_INVALID Invalid message ID provided
400 PEER_ID_INVALID The provided peer id is invalid
This site uses cookies, as described in the cookie policy. By clicking on "Accept" you consent to the use of cookies.