telegramsjs
    Preparing search index...

    Class PollingClient

    Represents a client for handling Telegram updates using long polling.

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    isClosed: boolean

    Indicates whether the polling client is closed.

    offset: number

    The offset used to keep track of the latest updates.

    Methods

    • Closes the polling client, stopping further updates.

      Returns boolean

      The closed state of the polling client.

    • Polls for new updates from Telegram.

      Parameters

      • options:
            | {
                allowedUpdates?: readonly (
                    | "poll"
                    | "message"
                    | "edited_message"
                    | "channel_post"
                    | "edited_channel_post"
                    | "business_connection"
                    | "business_message"
                    | "edited_business_message"
                    | "deleted_business_messages"
                    | "message_reaction"
                    | "message_reaction_count"
                    | "inline_query"
                    | "chosen_inline_result"
                    | "callback_query"
                    | "shipping_query"
                    | "pre_checkout_query"
                    | "poll_answer"
                    | "my_chat_member"
                    | "chat_member"
                    | "chat_join_request"
                    | "chat_boost"
                    | "removed_chat_boost"
                    | "purchased_paid_media"
                )[];
                dropPendingUpdates?: boolean;
                limit?: number;
                offset?: number;
                timeout?: number;
            }
            | undefined

        The polling options.

      Returns Promise<void>

    • Starts the polling process to receive updates from Telegram.

      Parameters

      • Optionaloptions: {
            allowedUpdates?: readonly (
                | "poll"
                | "message"
                | "edited_message"
                | "channel_post"
                | "edited_channel_post"
                | "business_connection"
                | "business_message"
                | "edited_business_message"
                | "deleted_business_messages"
                | "message_reaction"
                | "message_reaction_count"
                | "inline_query"
                | "chosen_inline_result"
                | "callback_query"
                | "shipping_query"
                | "pre_checkout_query"
                | "poll_answer"
                | "my_chat_member"
                | "chat_member"
                | "chat_join_request"
                | "chat_boost"
                | "removed_chat_boost"
                | "purchased_paid_media"
            )[];
            dropPendingUpdates?: boolean;
            limit?: number;
            offset?: number;
            timeout?: number;
        }

        The polling options.

      Returns Promise<void>