Layer 220
method Users Bots
messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;

Parameters

Name Type Description
Flags # Flags, see TL conditional fields
RevokeHistory flags.0?true Remove the entire chat history of the specified user in this chat.
ChatId long Chat ID
UserId InputUser User ID to be deleted

Returns

Updates

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.

Gogram Example

// MessagesDeleteChatUser - using Params struct
result, err := client.MessagesDeleteChatUser(&tg.MessagesDeleteChatUserParams{
    ChatId: int64(0),
    UserId: &tg.InputUserSelf{},

    // Optional fields:
    // RevokeHistory: true,
})
if err != nil {
    // handle error
}
// result is *tg.Updates