GetTopPeers
---functions---
contacts.getTopPeers#973478b6 correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true bots_guestchat:flags.17?true offset:int limit:int hash:long = contacts.TopPeers
Returns
Parameters
| correspondents | true | optional |
| bots_pm | true | optional |
| bots_inline | true | optional |
| phone_calls | true | optional |
| forward_users | true | optional |
| forward_chats | true | optional |
| groups | true | optional |
| channels | true | optional |
| bots_app | true | optional |
| bots_guestchat | true | optional |
| offset | int | required |
| limit | int | required |
| hash | long | required |
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::contacts::GetTopPeers {
correspondents: false,
bots_pm: false,
bots_inline: false,
phone_calls: false,
forward_users: false,
forward_chats: false,
groups: false,
channels: false,
bots_app: false,
bots_guestchat: false,
offset: 0_i32,
limit: 100_i32,
hash: 0_i64,
},
)
.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::contacts::GetTopPeers {
correspondents: false,
bots_pm: false,
bots_inline: false,
phone_calls: false,
forward_users: false,
forward_chats: false,
groups: false,
channels: false,
bots_app: false,
bots_guestchat: false,
offset: 0_i32,
limit: 100_i32,
hash: 0_i64,
},
)
.await?;
println!("{result:?}");
}
}
Ok(())
}