diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/discord.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/discord.rs b/src/discord.rs index 32cbf16..839b1c8 100644 --- a/src/discord.rs +++ b/src/discord.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use anyhow::Result; use chrono::prelude::*; -use evtclib::Log; +use evtclib::{Log, Outcome}; use serenity::client::bridge::gateway::ShardManager; use serenity::model::id::*; use serenity::prelude::*; @@ -110,9 +110,10 @@ fn insert_link(text: &str, log: &Log, link: &str) -> String { } fn state_emoji(log: &Log) -> &'static str { - if log.was_rewarded() { - "✅" - } else { - "❌" + let outcome = log.analyzer().and_then(|a| a.outcome()); + match outcome { + Some(Outcome::Success) => "✅", + Some(Outcome::Failure) => "❌", + None => "❓", } } |