GetMessagesRequest

Both users and bots can use this request. See code examples.

---functions---
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages

Returns

messages.Messages

This type can be an instance of either:

ChannelMessagesMessages
MessagesNotModifiedMessagesSlice

Parameters

idInputMessageA list must be supplied.

Known RPC errors

This request can't cause any RPC error as far as we know.

Example

Please refer to the documentation of client.iter_messages() to learn about the parameters and see several code examples on how to use it.

The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.messages.GetMessagesRequest(
        id=[42]
    ))
    print(result.stringify())