Method: channels.updatePaidMessagesPrice
Enable or disable paid messages » in this supergroup or monoforum.
Also used to enable or disable monoforums aka direct messages in a channel.
Note that passing the ID of the monoforum itself to channel will return a CHANNEL_MONOFORUM_UNSUPPORTED error: pass the ID of the associated channel to edit the settings of the associated monoforum, instead.
Parameters:
| Name | Type | Description | Required |
|---|---|---|---|
| broadcast_messages_allowed | Bool | Only usable for channels, enables or disables the associated monoforum aka direct messages. | Optional |
| channel | Username, chat ID, Update, Message or InputChannel | Pass the supergroup ID for supergroups and the ID of the channel to modify the setting in the associated monoforum. | Optional |
| send_paid_messages_stars | long | Specifies the required amount of Telegram Stars users must pay to send messages to the supergroup or monoforum. | Yes |
Return type: Updates
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();
$Updates = $MadelineProto->channels->updatePaidMessagesPrice(broadcast_messages_allowed: $Bool, channel: $InputChannel, send_paid_messages_stars: $long, );