Documentation - v0.32.0
    Preparing search index...

    Function sendEphemeralMessage

    • Send an ephemeral message — a message that is only visible to a single user in a chat and is not persisted in the chat history.

      Parameters

      • client: ITelegramClient
      • chatId: InputPeerLike | null

        ID of the chat to send the message to (null for guest chats, where queryId is used instead)

      • receiverId: InputPeerLike

        ID of the user the message should be visible to

      • text: InputText

        Text of the message

      • Optionalparams: {
            anchor?: boolean;
            forbidForwards?: boolean;
            invertMedia?: boolean;
            media?: InputMediaLike;
            queryId?: Long;
            replyMarkup?: ReplyMarkup;
            replyTo?: number;
            replyToEphemeral?: number;
            richMessage?: InputRichMessage;
            shouldDispatch?: true;
            uploadCache?: RichMediaUploadCache;
            welcome?: boolean;
        }
        • Optionalanchor?: boolean

          Whether to anchor this message to the message it replies to

        • OptionalforbidForwards?: boolean

          Whether to forbid forwarding this message

        • OptionalinvertMedia?: boolean

          Whether to invert the media position.

          Currently only supported for web previews and makes the client render the preview above the caption and not below.

        • Optionalmedia?: InputMediaLike

          Media to be attached to the message

        • OptionalqueryId?: Long

          For guest chat bots, ID of the query that this message is sent in response to

        • OptionalreplyMarkup?: ReplyMarkup

          Reply markup to be attached to the message

        • OptionalreplyTo?: number

          Message to reply to

        • OptionalreplyToEphemeral?: number

          Ephemeral message to reply to

        • OptionalrichMessage?: InputRichMessage

          Rich message content to be sent instead of the plain text

        • OptionalshouldDispatch?: true

          Whether to dispatch the returned updates to the client's update handler.

        • OptionaluploadCache?: RichMediaUploadCache

          Cache for the uploaded rich message media, see createRichStreamingDraft

        • Optionalwelcome?: boolean

          Whether to send this message as a welcome message template for the chat

      Returns Promise<EphemeralMessage>