Crates.io | rusty-blitzcrank |
lib.rs | rusty-blitzcrank |
version | 0.2.1 |
source | src |
created_at | 2023-02-17 20:27:02.446588 |
updated_at | 2023-09-26 11:28:32.219034 |
description | A batterys included library for the Riot API |
homepage | |
repository | |
max_upload_size | |
id | 787760 |
size | 103,864 |
A batterys included library for the Riot API
Explore the docs ยป
View Demo
.
Report Bug
.
Request Feature
The entire library is written in Rust.
You can simply use the library installing it with cargo.
You will need cargo installed
Get a free API Key at https://developer.riotgames.com/
Install
cargo add rusty-blitzcrank
use rusty_blitzcrank::*;
fn main() {
let mut client = apiclient::new("RGAPI-fffffff-aaaaae-dddd-cccc-1234567890".to_owned());
let reg = region::Region::from_str("KR").unwrap();
let summoner = &client.get_summoner_by_name("Hide on Bush", ®).unwrap();
let big_reg = region::Region::from_str("ASIA").unwrap();
let opts = Some(types::GetMatchIdsOpts {
count: Some(5),
start_time: None,
end_time: None,
queue: None,
game_type: Some(types::GameType::RANKED),
start: Some(0),
});
let match_ids = client
.get_match_ids(&summoner.puuid, &big_reg, opts)
.unwrap();
let m = client.get_match(&match_ids[0], &big_reg).unwrap();
dbg!(&m.metadata.participants);
let timeline = client.get_match_timeline(&match_ids[0], &big_reg).unwrap();
for frame in timeline.info.frames {
dbg!(&frame.participant_frames.n1.minions_killed);
}
let top_mast = client
.get_champion_mastery_top(&summoner.id, None, ®)
.unwrap();
dbg!(top_mast);
let score = client
.get_champion_mastery_score(&summoner.id, ®)
.unwrap();
dbg!(score);
}