Method: account.toggleNoPaidMessagesException
Allow a user to send us messages without paying if paid messages » are enabled.
Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
| refund_charged | Bool | If set and require_payment is not set, refunds the amounts the user has already paid us to send us messages (directly or via a monoforum). | Optional |
| require_payment | Bool | If set, requires the user to pay in order to send us messages. Can only be set by monoforums, not users, i.e. parent_peer must be set if this flag is set; users must instead use the inputPrivacyKeyNoPaidMessages privacy setting to remove a previously added exemption. If not set, allows the user to send us messages without paying (can be unset by both monoforums and users). | Optional |
| parent_peer | Username, chat ID, Update, Message or InputPeer | If set, applies the setting within the monoforum aka direct messages » (pass the ID of the monoforum, not the ID of the associated channel). | Optional |
| user_id | Username, chat ID, Update, Message or InputUser | The user to exempt or unexempt. | Optional |
Return type: Bool
Can users use this method: YES
Can bots use this method: NO
Can bots use this method over a business connection with the businessConnectionId flag: NO
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();
$Bool = $MadelineProto->account->toggleNoPaidMessagesException(refund_charged: $Bool, require_payment: $Bool, parent_peer: $InputPeer, user_id: $InputUser, );