8 个版本
0.2.1 | 2023 年 9 月 26 日 |
---|---|
0.2.0 | 2023 年 4 月 5 日 |
0.1.5 | 2023 年 3 月 20 日 |
0.1.3 | 2023 年 2 月 24 日 |
#1521 in 网页编程
105KB
3K SLoC
Rusty Blitzcrank
包含电池的 Riot API 库
探索文档 »
查看演示 . 报告错误 . 请求功能
目录
构建工具
整个库是用 Rust 编写的。
入门指南
您可以通过 cargo 安装库来简单地使用它。
先决条件
您需要安装 cargo
- cargo
安装
-
在 https://developer.riotgames.com/ 获取免费的 API 密钥
-
安装
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);
}
依赖项
~6–20MB
~292K SLoC