MadelineProtoDocs/docs/API_docs/methods/channels.toggleViewForumAsMessages.md
2024-05-01 14:53:46 +02:00

2.1 KiB

title description grand_parent parent image redirect_from
channels.toggleViewForumAsMessages Users may also choose to display messages from all topics of a [forum](https://core.telegram.org/api/forum) as if they were sent to a normal group, using a 'View as messages' setting in the local client: this setting only affects the current account, and is synced to other logged in sessions using this method. Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/channels_toggleViewForumAsMessages.html

Method: channels.toggleViewForumAsMessages

Back to methods index

Users may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a "View as messages" setting in the local client: this setting only affects the current account, and is synced to other logged in sessions using this method.

Invoking this method will update the value of the view_forum_as_messages flag of channelFull or dialog and emit an updateChannelViewForumAsMessages.

Parameters:

Name Type Description Required
channel Username, chat ID, Update, Message or InputChannel The forum Optional
enabled Bool The new value of the view_forum_as_messages flag. Yes

Return type: Updates

Can bots use this method: 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->toggleViewForumAsMessages(channel: $InputChannel, enabled: $Bool, );