mirror of
https://github.com/tribufu/sdk-rust
synced 2025-06-15 10:44:18 +00:00
24 lines
541 B
Rust
24 lines
541 B
Rust
// Copyright (c) Tribufu. All Rights Reserved
|
|
|
|
use dotenv::dotenv;
|
|
use std::env;
|
|
use tribufu::*;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
dotenv().ok();
|
|
|
|
let client_id = env::var("CLIENT_ID").unwrap().parse::<u64>().unwrap();
|
|
let client_secret = env::var("CLIENT_SECRET").unwrap();
|
|
|
|
let mut client = TribufuClient::new(client_id, client_secret).unwrap();
|
|
|
|
client.get_token(None).await.unwrap();
|
|
|
|
let games = client.get_games().await.unwrap();
|
|
|
|
games.iter().for_each(|game| {
|
|
println!("{}", game.name);
|
|
});
|
|
}
|