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
| Name | Type | Required | Description |
|---|---|---|---|
Big | bool | — | Whether a bigger and longer reaction should be shown |
AddToRecent | bool | — | Whether to add this reaction to the recent reactions list ». |
Peer | InputPeerClass | yes | Peer |
MsgID | int | yes | Message ID to react to |
Reaction | []ReactionClass | — | A list of reactions (doesn't accept reactionPaid constructors, use messages sendPaidReaction to send paid reactions, instead). |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 403 | ANONYMOUS_REACTIONS_DISABLED | Sorry, anonymous administrators cannot leave reactions or participate in polls. |
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHANNEL_PRIVATE | You haven't joined this channel/supergroup. |
| 403 | CHAT_WRITE_FORBIDDEN | You can't write in this chat. |
| 400 | CUSTOM_REACTIONS_TOO_MANY | Too many custom reactions were specified. |
| 400 | DOCUMENT_INVALID | The specified document is invalid. |
| 400 | MESSAGE_ID_INVALID | The provided message id is invalid. |
| 400 | MESSAGE_NOT_MODIFIED | The provided message data is identical to the previous message data, the message wasn't modified. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 403 | PREMIUM_ACCOUNT_REQUIRED | A premium account is required to execute this action. |
| 400 | REACTIONS_TOO_MANY | The message already has exactly reactions_uniq_max reaction emojis, you can't react with a new emoji, see the docs for more info ». |
| 400 | REACTION_EMPTY | Empty reaction provided. |
| 400 | REACTION_INVALID | The specified reaction is invalid. |
| 400 | USER_BANNED_IN_CHANNEL | You're banned from sending messages in supergroups/channels. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.sendReaction#d30d78d4