messages.sendPaidReaction #

Sends one or more paid Telegram Star reactions », transferring Telegram Stars » to a channel's balance.

Layer 223

updatesTooLong#e317af7e = Updates;
updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
---functions---
messages.sendPaidReaction#58bbcb50 flags:# peer:InputPeer msg_id:int count:int random_id:long private:flags.0?PaidReactionPrivacy = Updates;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
peerInputPeerThe channel
msg_idintThe message to react to
countintThe number of stars to send (each will increment the reaction counter by one).
random_idlongUnique client message ID required to prevent message resending. Note: this argument must be composed of a 64-bit integer where the lower 32 bits are random, and the higher 32 bits are equal to the current unixtime, i.e. `uint64_t random_id = (time() << 32). See here » for more info on random ID deduplication and updateMessageID mapping.
privateflags.0?PaidReactionPrivacyEach post with star reactions has a leaderboard with the top senders, but users can opt out of appearing there if they prefer more privacy. Not populating this field will use the default reaction privacy, stored on the server and synced to clients using updatePaidReactionPrivacy (see here for more info).

Result #

Updates

Only users can use this method #

Possible errors #

CodeTypeDescription
400BALANCE_TOO_LOWThe transaction cannot be completed because the current Telegram Stars balance is too low.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.
400RANDOM_ID_EMPTYRandom ID empty.
400RANDOM_ID_EXPIREDThe specified random_id was expired (most likely it didn't follow the required `uint64_t random_id = (time() << 32)
400REACTIONS_COUNT_INVALIDThe specified number of reactions is invalid.
400SEND_AS_PEER_INVALIDYou can't send messages as the specified peer.

Telegram Stars #

Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.

Working with Updates #

How to subscribe to updates and handle them properly.

updatePaidReactionPrivacy #

Contains the current default paid reaction privacy, see here » for more info.

Clients should invoke messages.getPaidReactionPrivacy on startup to fetch the current default reaction privacy because this update is only sent to currently online sessions and cannot be fetched using getDifference on client startup.

Message reactions #

Telegram allows users to react on any message using specific emojis, triggering cute lottie animations.