Link Search Menu Expand Document

Method: channels.updatePaidMessagesPrice

Back to methods index

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:

NameTypeDescriptionRequired
broadcast_messages_allowedBoolOnly usable for channels, enables or disables the associated monoforum aka direct messages.Optional
channelUsername, chat ID, Update, Message or InputChannelPass the supergroup ID for supergroups and the ID of the channel to modify the setting in the associated monoforum.Optional
send_paid_messages_starslongSpecifies 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, );