Skip to main content

messages.sendReaction

React to message. Starting from layer 159, the reaction will be sent from the peer specified using messages.saveDefaultSendAs.

func (c *Client) MessagesSendReaction(ctx context.Context, request *MessagesSendReactionRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.MessagesSendReaction(ctx, &tg.MessagesSendReactionRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
BigboolWhether a bigger and longer reaction should be shown
AddToRecentboolWhether to add this reaction to the recent reactions list ».
PeerInputPeerClassyesPeer
MsgIDintyesMessage ID to react to
Reaction[]ReactionClassA list of reactions (doesn't accept reactionPaid constructors, use messages sendPaidReaction to send paid reactions, instead).

Returns

UpdatesClass

Possible errors

CodeTypeDescription
403ANONYMOUS_REACTIONS_DISABLEDSorry, anonymous administrators cannot leave reactions or participate in polls.
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
400CUSTOM_REACTIONS_TOO_MANYToo many custom reactions were specified.
400DOCUMENT_INVALIDThe specified document is invalid.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400MESSAGE_NOT_MODIFIEDThe provided message data is identical to the previous message data, the message wasn't modified.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
403PREMIUM_ACCOUNT_REQUIREDA premium account is required to execute this action.
400REACTIONS_TOO_MANYThe message already has exactly reactions_uniq_max reaction emojis, you can't react with a new emoji, see the docs for more info ».
400REACTION_EMPTYEmpty reaction provided.
400REACTION_INVALIDThe specified reaction is invalid.
400USER_BANNED_IN_CHANNELYou're banned from sending messages in supergroups/channels.

References