send_paid_reaction()

async Client.send_paid_reaction()

Send a paid reaction to a message, spending Telegram Stars.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat.

  • message_id (int) – Identifier of the message to react to.

  • amount (int) – Number of Telegram Stars to spend, one star per reaction.

  • privacy (PaidReactionPrivacy, optional) – Who the reaction is shown as. Defaults to the account setting.

  • send_as (int | str, optional) – Chat to react as. Required when privacy is CHAT.

Returns:

bool – On success, True is returned.

Raises:

ValueError – In case privacy is CHAT and no send_as chat is given.

Example

# Send five stars
await app.send_paid_reaction(chat_id, message_id, 5)

# Send them anonymously
await app.send_paid_reaction(
    chat_id, message_id, 5,
    privacy=enums.PaidReactionPrivacy.ANONYMOUS
)