});
command!(blague(ctx, msg, args) {
let mut data = ctx.data.lock();
let scores = data
.get::<Score>()
.expect("Expected Score in ShareMap.");
let mut res = "Blagues :\n".to_string();
if args.len() >= 1 {
for name in args.iter() {
let name = get_user_id(name.unwrap()).unwrap_or("".to_string());
match scores.get(&name) {
Some(v) => write!(res, "- {}: {}\n", name, v).unwrap(),
None => (),
}
}
} else {
for (k, v) in scores {
let _ = write!(res, "- {}: {}\n", k, v);
}
}
if let Err(why) = msg.channel_id.say(&res) {
println!("Error sending message: {:?}", why);
}