CreateChannel
---functions--- channels.createChannel#91006707 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 |
Parameters
| broadcast | true | optional |
| megagroup | true | optional |
| for_import | true | optional |
| forum | true | optional |
| title | string | required |
| about | string | required |
| geo_point | InputGeoPoint | optional |
| address | string | optional |
| ttl_period | int | optional |
Example
The examples below use placeholder values. Replace them with real data before running the code.
▶ Minimal
import asyncio
from ferogram import Client
app = Client("my_session", api_id=12345, api_hash="0123456789abcdef0123456789abcdef")
async def main():
await app.start()
result = await app.raw.channels.CreateChannel(
title='My title',
about='some string here'
)
print(result)
asyncio.run(main())
The minimal example uses Ferogram's raw proxy shorthand. Peers can be passed as strings and required primitives get safe defaults. Expand Full API to see every parameter.
▶ Full API
import asyncio
from ferogram import Client, raw
app = Client("my_session", api_id=12345, api_hash="0123456789abcdef0123456789abcdef")
async def main():
await app.start()
result = await app(raw.functions.channels.CreateChannel(
broadcast=True,
megagroup=True,
for_import=True,
forum=True,
title='My title',
about='some string here',
geo_point=raw.types.InputGeoPointEmpty(),
address='some string here',
ttl_period=42
))
print(result)
asyncio.run(main())