Skip to content
This repository was archived by the owner on Dec 24, 2025. It is now read-only.

Commit 1b6142c

Browse files
committed
Add missing 'normal' rank color, add player name
1 parent 236a42a commit 1b6142c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/api_documentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ Response varies for each `request_type`:
676676

677677
`player_data`
678678

679+
- `name`: `string` - The player's name, as stored by Hypixel
679680
- `bedwars`: `BedwarsData`
680681
- `skywars`: `SkywarsData`
681682
- `duels`: `DuelsData`

src/endpoints/hypixel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ enum RequestType {
8181

8282
#[derive(Serialize)]
8383
struct PlayerData {
84+
name: String,
8485
bedwars: BedwarsData,
8586
skywars: SkywarsData,
8687
duels: DuelsData,
@@ -100,6 +101,7 @@ impl PlayerData {
100101
network_exp += leveling::get_total_exp_to_full_level(player["networkLevel"].as_f64().unwrap_or(0f64) + 1f64);
101102
let network_level = leveling::get_exact_level(network_exp);
102103
PlayerData {
104+
name: player["displayname"].as_str().unwrap_or_default().to_owned(),
103105
bedwars,
104106
skywars,
105107
duels,
@@ -185,7 +187,7 @@ impl Rank {
185187

186188
fn to_string_formatted(&self, plus_color: Option<&str>, superstar_color: Option<&str>) -> String {
187189
match self {
188-
Rank::Normal => "".to_owned(),
190+
Rank::Normal => "§7".to_owned(),
189191
Rank::Vip => "§a[VIP]".to_owned(),
190192
Rank::VipPlus => "§a[VIP§6+§a]".to_owned(),
191193
Rank::Mvp => "§b[MVP]".to_owned(),

0 commit comments

Comments
 (0)