Link Search Menu Expand Document

Method: messages.deleteChatUser

Back to methods index

Deletes a user from a chat and sends a service message on it.


revoke_historyBoolRemove the entire chat history of the specified user in this chat.Optional
chat_idUsername, chat ID, Update, Message or InputPeerOptional
user_idUsername, chat ID, Update, Message or InputUserUser ID to be deletedOptional

Return type: Updates

Can bots use this method: YES

MadelineProto Example (now async for huge speed and parallelism!):

if (!file_exists('madeline.php')) {
    copy('', 'madeline.php');
include 'madeline.php';

$MadelineProto = new \danog\MadelineProto\API('session.madeline');

// PHP 8+ syntax, use an array on PHP 7.
$Updates = $MadelineProto->messages->deleteChatUser(revoke_history: Bool, chat_id: InputPeer, user_id: InputUser, );