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

2.7 KiB

title description grand_parent parent image redirect_from
channels.createChannel Create a [supergroup/channel](https://core.telegram.org/api/channel). Telegram RPC API Methods https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png /API_docs/methods/channels_createChannel.html

Method: channels.createChannel

Back to methods index

Create a supergroup/channel.

Parameters:

Name Type Description Required
broadcast Bool Whether to create a channel Optional
megagroup Bool Whether to create a supergroup Optional
for_import Bool Whether the supergroup is being created to import messages from a foreign chat service using messages.initHistoryImport Optional
forum Bool Whether to create a forum Optional
title string Channel title Optional
about string Channel description Optional
geo_point InputGeoPoint Geogroup location, see here » for more info on geogroups. Optional
address string Geogroup address, see here » for more info on geogroups. Optional
ttl_period int Time-to-live of all messages that will be sent in the supergroup: once message.date+message.ttl_period === time(), the message will be deleted on the server, and must be deleted locally as well. You can use messages.setDefaultHistoryTTL to edit this value later. Optional

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->createChannel(broadcast: $Bool, megagroup: $Bool, for_import: $Bool, forum: $Bool, title: 'string', about: 'string', geo_point: $InputGeoPoint, address: 'string', ttl_period: $int, );