telegram api method · layer 229 · #58bbcb50

messages.sendPaidReaction

usable by users

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

definition

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) | ((uint64_t)random_uint32_t()): this differs from the random_id format of all other methods in the API, which just take 64 random bits.
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).

returns

Updates

errors (12)

codeerrordescription
400BALANCE_TOO_LOWThe transaction cannot be completed because the current Telegram Stars balance is too low.
400BUSINESS_CONNECTION_NOT_ALLOWEDThis method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
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) | ((uint64_t)random_uint32_t()) format, or the specified time is too far in the past).
400REACTIONS_COUNT_INVALIDThe specified number of reactions is invalid.
400SEND_AS_PEER_INVALIDYou can't send messages as the specified peer.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).
403CHAT_WRITE_FORBIDDENYou can't write in this chat.

history

present in layers 186–229 · constructor id changed 2×

idlayers
#25c8fe3e186
#9dd6a67b187–198
#58bbcb50199–229