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
Parameters
Example
Replace placeholder values with real data before running.
use ferogram::tl::functions;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let (client, _) = ferogram::Client::quick_connect(
"my.session",
12345,
"0123456789abcdef0123456789abcdef",
)
.await?;
let result = client
.invoke(
&functions::channels::CreateChannel {
broadcast: false,
megagroup: false,
for_import: false,
forum: false,
title: "My title".to_string(),
about: "".to_string(),
geo_point: None,
address: None,
ttl_period: None,
},
)
.await?;
println!("{result:?}");
Ok(())
}
use ferogram::tl::functions;
use ferogram::update::Update;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let (client, _) = ferogram::Client::quick_connect(
"my.session",
12345,
"0123456789abcdef0123456789abcdef",
)
.await?;
let mut stream = client.stream_updates();
while let Some(upd) = stream.next().await {
if let Update::NewMessage(_msg) = upd {
let result = client
.invoke(
&functions::channels::CreateChannel {
broadcast: false,
megagroup: false,
for_import: false,
forum: false,
title: "My title".to_string(),
about: "".to_string(),
geo_point: None,
address: None,
ttl_period: None,
},
)
.await?;
println!("{result:?}");
}
}
Ok(())
}