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

2.3 KiB

title description grand_parent parent image redirect_from
channels.createForumTopic Create a [forum topic](https://core.telegram.org/api/forum); requires [`manage_topics` rights](https://core.telegram.org/api/rights). Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/channels_createForumTopic.html

Method: channels.createForumTopic

Back to methods index

Create a forum topic; requires manage_topics rights.

Parameters:

Name Type Description Required
channel Username, chat ID, Update, Message or InputChannel The forum Optional
title string Topic title (maximum UTF-8 length: 128) Optional
icon_color int If no custom emoji icon is specified, specifies the color of the fallback topic icon (RGB), one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Optional
icon_emoji_id long ID of the custom emoji used as topic icon. Telegram Premium users can use any custom emoji, other users can only use the custom emojis contained in the inputStickerSetEmojiDefaultTopicIcons emoji pack. Optional
send_as Username, chat ID, Update, Message or InputPeer Create the topic as the specified peer Optional

Return type: Updates

Can bots use this method: YES

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->createForumTopic(channel: $InputChannel, title: 'string', icon_color: $int, icon_emoji_id: $long, send_as: $InputPeer, );