CreateChannelRequest

Only users can use this request. See code examples.

---functions---
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

Returns

Updates

This type can be an instance of either:

UpdateShortUpdateShortChatMessage
UpdateShortMessageUpdateShortSentMessage
UpdatesUpdatesCombined
UpdatesTooLong

Parameters

titlestring
aboutstring
broadcastflagThis argument defaults to None and can be omitted.
megagroupflagThis argument defaults to None and can be omitted.
for_importflagThis argument defaults to None and can be omitted.
forumflagThis argument defaults to None and can be omitted.
geo_pointInputGeoPointThis argument defaults to None and can be omitted.
addressstringThis argument defaults to None and can be omitted.
ttl_periodintThis argument defaults to None and can be omitted.

Known RPC errors

This request can cause 2 known errors:

ChatTitleEmptyErrorNo chat title provided.
UserRestrictedErrorYou're spamreported, you can't create channels or chats..

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.channels.CreateChannelRequest(
        title='My awesome title',
        about='some string here',
        megagroup=True,
        for_import=True,
        forum=True,
        geo_point=types.InputGeoPoint(
            lat=7.13,
            long=7.13,
            accuracy_radius=42
        ),
        address='some string here',
        ttl_period=42
    ))
    print(result.stringify())