messages.deleteChatUser
Deletes a user from a chat and sends a service message on it.
func (c *Client) MessagesDeleteChatUser(ctx context.Context, request *MessagesDeleteChatUserRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesDeleteChatUser(ctx, &tg.MessagesDeleteChatUserRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
RevokeHistory | bool | — | Remove the entire chat history of the specified user in this chat. |
ChatID | int64 | yes | Chat ID |
UserID | InputUserClass | yes | User ID to be deleted |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | INPUT_USER_DEACTIVATED | The specified user was deleted. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
| 400 | USER_NOT_PARTICIPANT | You're not a member of this supergroup/channel. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.deleteChatUser#a2185cab