telegram api method · layer 229 · #91006707
channels.createChannel
Create a supergroup/channel.
definition
channels.createChannel#91006707 flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true forum:flags.5?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string ttl_period:flags.4?int = Updates;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
broadcast | true | Whether to create a channel |
megagroup | true | Whether to create a supergroup |
for_import | true | Whether the supergroup is being created to import messages from a foreign chat service using messages.initHistoryImport |
forum | true | Whether to create a forum |
title | string | Channel title |
about | string | Channel description |
geo_point | InputGeoPoint | Geogroup location, see here » for more info on geogroups. |
address | string | Geogroup address, see here » for more info on geogroups. |
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. |
returns
errors (12)
| code | error | description |
|---|---|---|
| 400 | ADDRESS_INVALID | The specified geopoint address is invalid. |
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 400 | CHANNELS_ADMIN_LOCATED_TOO_MUCH | The user has reached the limit of public geogroups. |
| 400 | CHANNELS_TOO_MUCH | You have joined too many channels/supergroups. |
| 400 | CHAT_ABOUT_TOO_LONG | Chat about too long. |
| 400 | CHAT_TITLE_EMPTY | No chat title provided. |
| 400 | TTL_PERIOD_INVALID | The specified TTL period is invalid. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
| 403 | USER_RESTRICTED | You're spamreported, you can't create channels or chats. |
| 406 | USER_RESTRICTED | You're spamreported, you can't create channels or chats. |
| 420 | ADDRESS_INVALID | The specified geopoint address is invalid. |
| 500 | CHAT_INVALID | Invalid chat. |
history
present in layers 46–229 · constructor id changed 2×
| id | layers |
|---|---|
| #f4893d7f | 46–101 |
| #3d5fb10f | 102–149 |
| #91006707 | 150–229 |