Method: contacts.block

Back to methods index

Block a user


Name Type Description Required
id Username, chat ID, Update, Message or InputUser The user to block Optional

Return type: Bool

Can bots use this method: NO

MadelineProto Example:

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

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

$Bool = $MadelineProto->contacts->block(['id' => InputUser, ]);

PWRTelegram HTTP API example (NOT FOR MadelineProto):

As a user:



id - Json encoded InputUser

Or, if you’re into Lua:

Bool = contacts.block({id=InputUser, })

Errors this method can return:

Error Description
CONTACT_ID_INVALID The provided contact ID is invalid