ImportBotAuthorization

---functions---
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization

Returns

auth.Authorization

Parameters

flagsintrequired
api_idintrequired
api_hashstringrequired
bot_auth_tokenstringrequired

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::auth::ImportBotAuthorization {
            api_id: 0_i32,
            api_hash: "".to_string(),
            bot_auth_token: "".to_string(),
        },
        )
        .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::auth::ImportBotAuthorization {
                api_id: 0_i32,
                api_hash: "".to_string(),
                bot_auth_token: "".to_string(),
            },
                )
                .await?;
            println!("{result:?}");
        }
    }
    Ok(())
}