send_ephemeral_message()

Client.send_ephemeral_message()

Send an ephemeral message to a bot within a peer context.

Ephemeral messages are visible only to the receiver bot and disappear once read. Used for private bot interactions within a group context.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – The peer context (chat) for the ephemeral message.

  • receiver_id (int | str) – The bot user that will receive the ephemeral message.

  • text (str) – The message text.

  • query_id (int, optional) – Callback query ID, if replying to a bot query.

Returns:

Updates – On success.

Example

await app.send_ephemeral_message(chat_id, "@mybot", "hello")