mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 15:45:35 +00:00
* add formatting Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> * Apply Changes --------- Signed-off-by: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com>
26 lines
831 B
Rust
26 lines
831 B
Rust
pub use vrchatapi::apis;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let mut config = apis::configuration::Configuration::default();
|
|
config.basic_auth = Some((String::from("username"), Some(String::from("password"))));
|
|
|
|
match apis::authentication_api::get_current_user(&config)
|
|
.await
|
|
.unwrap()
|
|
{
|
|
vrchatapi::models::EitherUserOrTwoFactor::CurrentUser(me) => {
|
|
println!("Username: {}", me.username.unwrap())
|
|
}
|
|
vrchatapi::models::EitherUserOrTwoFactor::RequiresTwoFactorAuth(requires_auth) => println!(
|
|
"The Username requires Auth: {:?}",
|
|
requires_auth.requires_two_factor_auth
|
|
),
|
|
}
|
|
|
|
let online = apis::system_api::get_current_online_users(&config)
|
|
.await
|
|
.unwrap();
|
|
println!("Current Online Users: {}", online);
|
|
}
|