Link Search Menu Expand Document

Method: account.toggleNoPaidMessagesException

Back to methods index

Allow a user to send us messages without paying if paid messages » are enabled.

Parameters:

NameTypeDescriptionRequired
refund_chargedBoolIf 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_paymentBoolIf 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_peerUsername, chat ID, Update, Message or InputPeerIf 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_idUsername, chat ID, Update, Message or InputUserThe 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, );