Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ca9c85aa0 |
@@ -164,10 +164,19 @@ pub fn get_top(msg: Message, bot: Bot) -> <Bot as Requester>::SendMessage {
|
||||
let db = database::DatabasePole::get_database();
|
||||
let top = db.get_top_users(&msg.chat.id.0.to_string());
|
||||
let mut repl = String::new();
|
||||
for u in top {
|
||||
repl.push_str(&(u.1 + ": " + &u.0.to_string() + " puntos\n"));
|
||||
|
||||
for (i, u) in top.iter().enumerate() {
|
||||
let medal = match i {
|
||||
0 => "🥇 ",
|
||||
1 => "🥈 ",
|
||||
2 => "🥉 ",
|
||||
_ => "",
|
||||
};
|
||||
|
||||
repl.push_str(&format!("{}{}: {} puntos\n", medal, u.1, u.0));
|
||||
}
|
||||
bot.send_message(msg.chat.id, format!("{}", repl))
|
||||
|
||||
bot.send_message(msg.chat.id, repl)
|
||||
}
|
||||
|
||||
/*#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user