fix(tripple): Check for absolute value for time diff

This commit is contained in:
andreas 2019-07-02 21:26:27 +02:00
parent 82102b954e
commit caa2ec1182

View File

@ -108,7 +108,7 @@ fn main() {
format!("{} just hit leet! New score: {}", message.from.first_name, *entry) format!("{} just hit leet! New score: {}", message.from.first_name, *entry)
)); ));
let current_leet_count = time_scored_map.iter().filter(|(_,t)| (**t - Local::now()).num_seconds() < allowed_timegap * 2).count(); let current_leet_count = time_scored_map.iter().filter(|(_,t)| (**t - Local::now()).num_seconds().abs() < allowed_timegap * 2).count();
if current_leet_count == 3 { if current_leet_count == 3 {
api.spawn(message.chat.text("OH BABY A TRIPPLE!!!")); api.spawn(message.chat.text("OH BABY A TRIPPLE!!!"));