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.

Parameters:

NameTypeDescriptionRequired
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('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';

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

$Updates = $MadelineProto->messages->deleteChatUser(revoke_history: $Bool, chat_id: $InputPeer, user_id: $InputUser, );