teleproto - v1.229.0
    Preparing search index...

    Interface IterMessagesParams

    Interface for iterating over messages. used in both TelegramClient.iterMessages and TelegramClient.getMessages.

    interface IterMessagesParams {
        addOffset: number;
        filter?: TypeMessagesFilter | TypeMessagesFilter[];
        fromUser?: EntityLike;
        ids?: number | number[] | TypeInputMessage | TypeInputMessage[];
        limit?: number;
        maxId: number;
        minId: number;
        offsetDate?: number;
        offsetId: number;
        replyTo?: number;
        reverse?: boolean;
        savedPeerId?: EntityLike;
        scheduled: boolean;
        search?: string;
        topMsgId?: number;
        waitTime?: number;
    }
    Index
    addOffset: number

    Additional message offset (all of the specified offsets + this offset = older messages).

    The filter to use when returning messages.
    For instance, InputMessagesFilterPhotos would yield only messages containing photos.

    fromUser?: EntityLike

    Only messages from this user will be returned.

    ids?: number | number[] | TypeInputMessage | TypeInputMessage[]

    A single integer ID (or several IDs) for the message that should be returned.
    This parameter takes precedence over the rest (which will be ignored if this is set).
    This can for instance be used to get the message with ID 123 from a channel.
    Note that if the message doesn"t exist, undefined will appear in its place.

    limit?: number

    Number of messages to be retrieved.
    Due to limitations with the API retrieving more than 3000 messages will take longer than half a minute. (might even take longer)
    if undefined is passed instead of a number the library will try to retrieve all the messages.

    maxId: number

    All the messages with a higher (newer) ID or equal to this will be excluded.

    minId: number

    All the messages with a lower (older) ID or equal to this will be excluded.

    offsetDate?: number

    Offset date (messages previous to this date will be retrieved). Exclusive.

    offsetId: number

    Offset message ID (only messages previous to the given ID will be retrieved). Exclusive.

    replyTo?: number

    If set to a message ID, the messages that reply to this ID will be returned.
    This feature is also known as comments in posts of broadcast channels, or viewing threads in groups.
    This feature can only be used in broadcast channels and their linked supergroups. Using it in a chat or private conversation will result in PEER_ID_INVALID error.
    When using this parameter, the filter and search parameters have no effect, since Telegram's API doesn't support searching messages in replies.

    reverse?: boolean

    If set to true, the messages will be returned in reverse order (from oldest to newest, instead of the default newest to oldest).
    This also means that the meaning of offsetId and offsetDate parameters is reversed, although they will still be exclusive.
    minId becomes equivalent to offsetId instead of being maxId as well since messages are returned in ascending order.
    You cannot use this if both entity and ids are undefined.

    savedPeerId?: EntityLike

    When searching your Saved Messages, restrict results to messages originally sent by this peer.

    scheduled: boolean

    If set to true, messages which are scheduled will be returned. All other parameters will be ignored for this, except entity.

    search?: string

    The string to be used as a search query.

    topMsgId?: number

    Restrict results to a forum topic by its top message ID. Only takes effect when combined with search, filter or fromUser (server-side search).

    waitTime?: number

    Wait time (in seconds) between different GetHistory requests.
    Use this parameter to avoid hitting the FloodWaitError as needed.
    If left to undefined, it will default to 1 second only if the number of messages is higher than 3000. If the ids parameter is used, this time will default to 10 seconds only if the amount of IDs is higher than 300.