fixed for archeology

This commit is contained in:
Raatty 2020-05-23 12:18:29 +12:00
parent d29647b87c
commit 9d3b6fd976
2 changed files with 10 additions and 6 deletions

View File

@ -11,6 +11,7 @@ serde = { version = "1.0.101", features = ["derive"] }
rand = "0.6" rand = "0.6"
typemap = "0.3" typemap = "0.3"
chrono = "0.4" chrono = "0.4"
num-format = "0.4"
[profile.release] [profile.release]
codegen-units = 1 codegen-units = 1

View File

@ -3,6 +3,7 @@ use serenity::{
framework::standard::{macros::command, Args, CommandResult}, framework::standard::{macros::command, Args, CommandResult},
model::channel::Message, model::channel::Message,
}; };
use num_format::{Locale, ToFormattedString};
#[command] #[command]
#[description = "echos the message given"] #[description = "echos the message given"]
@ -31,7 +32,7 @@ pub fn profile(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
profile.questsstarted, profile.questsstarted,
profile.rank.clone().unwrap_or("none".to_string()), profile.rank.clone().unwrap_or("none".to_string()),
profile.totalskill, profile.totalskill,
profile.totalxp, profile.totalxp.to_formatted_string(&Locale::en),
profile.combatlevel profile.combatlevel
); );
let mut stats_extended: Vec<SkillValueExtended> = profile let mut stats_extended: Vec<SkillValueExtended> = profile
@ -41,7 +42,7 @@ pub fn profile(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
.collect(); .collect();
stats_extended.sort_by(|s1, s2| ORDER[s1.id as usize].cmp(&ORDER[s2.id as usize])); stats_extended.sort_by(|s1, s2| ORDER[s1.id as usize].cmp(&ORDER[s2.id as usize]));
let mut left = String::new(); let mut left = String::new();
for i in 0..27 { for i in 0..28 {
if i % 3 == 0 { if i % 3 == 0 {
left.push('\n') left.push('\n')
} }
@ -128,7 +129,7 @@ impl std::convert::From<&SkillValue> for SkillValueExtended {
} }
} }
static SKILL_NAMES: [&'static str; 27] = [ static SKILL_NAMES: [&'static str; 28] = [
"Attack", "Attack",
"Defence", "Defence",
"Strength", "Strength",
@ -156,14 +157,15 @@ static SKILL_NAMES: [&'static str; 27] = [
"Dungeoneering", "Dungeoneering",
"Divination", "Divination",
"Invention", "Invention",
"Archeology"
]; ];
static ORDER: [u32; 27] = [ static ORDER: [u32; 28] = [
1, 7, 4, 2, 10, 13, 16, 12, 18, 17, 9, 15, 14, 6, 3, 8, 5, 11, 20, 21, 19, 23, 22, 24, 25, 26, 1, 7, 4, 2, 10, 13, 16, 12, 18, 17, 9, 15, 14, 6, 3, 8, 5, 11, 20, 21, 19, 23, 22, 24, 25, 26,
27, 27, 28
]; ];
static EMOJIS: [&'static str; 27] = [ static EMOJIS: [&'static str; 28] = [
"<:Attack:406361343223136256>", "<:Attack:406361343223136256>",
"<:Defence:406361343348834304>", "<:Defence:406361343348834304>",
"<:Strength:406361343357222914>", "<:Strength:406361343357222914>",
@ -191,4 +193,5 @@ static EMOJIS: [&'static str; 27] = [
"<:Dungeoneering:406361343386451979>", "<:Dungeoneering:406361343386451979>",
"<:Divination:406361343374131211>", "<:Divination:406361343374131211>",
"<:Invention:406361343591972864>", "<:Invention:406361343591972864>",
"<:Archeology:713541764874764289>"
]; ];