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

contacts.TopPeers

Parameters

correspondentstrueoptional
bots_pmtrueoptional
bots_inlinetrueoptional
phone_callstrueoptional
forward_userstrueoptional
forward_chatstrueoptional
groupstrueoptional
channelstrueoptional
bots_apptrueoptional
bots_guestchattrueoptional
offsetintrequired
limitintrequired
hashlongrequired

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(())
}