Skip to main content

messages.setTyping

Sends a current user typing event (see SendMessageAction for all event types) to a conversation partner or group.

func (c *Client) MessagesSetTyping(ctx context.Context, request *MessagesSetTypingRequest) (bool, error)

Calling this method

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

res, err := api.MessagesSetTyping(ctx, &tg.MessagesSetTypingRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesTarget user or group
TopMsgIDintTopic ID
ActionSendMessageActionClassyesType of action

Returns

bool

Possible errors

CodeTypeDescription
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400BUSINESS_PEER_INVALIDMessages can't be set to the specified peer through the current business connection.
400BUSINESS_PEER_USAGE_MISSINGYou cannot send a message to a user through a business connection if the user hasn't recently contacted us.
400CHANNEL_INVALIDThe provided channel is invalid.
406CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_ID_INVALIDThe provided chat id is invalid.
403CHAT_WRITE_FORBIDDENYou can't write in this chat.
403GROUPCALL_FORBIDDENThe group call has already ended.
400INPUT_USER_DEACTIVATEDThe specified user was deleted.
400MESSAGE_TOO_LONGThe provided message is too long.
400MSG_ID_INVALIDInvalid message ID provided.
406PEER_ID_INVALIDThe provided peer id is invalid.
400USER_BANNED_IN_CHANNELYou're banned from sending messages in supergroups/channels.
403USER_IS_BLOCKEDYou were blocked by this user.
400USER_IS_BOTBots can't send messages to other bots.

References