From 36dc11d82fdc7b5db965f0c33c1ee5da9aa1818c Mon Sep 17 00:00:00 2001 From: troido Date: Tue, 21 Apr 2020 18:14:52 +0200 Subject: added options notification --- src/components/ear.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/components/ear.rs') diff --git a/src/components/ear.rs b/src/components/ear.rs index 1432164..4aafa72 100644 --- a/src/components/ear.rs +++ b/src/components/ear.rs @@ -35,6 +35,10 @@ pub enum Notification { Die { actor: String, target: String + }, + Options { + description: String, + options: Vec<(String, String)> } } @@ -53,7 +57,8 @@ impl Notification { Heal => "heal" }, Kill{actor: _, target: _} => "kill", - Die{actor: _, target: _} => "die" + Die{actor: _, target: _} => "die", + Options{description: _, options: _} => "options" }).to_string() } @@ -77,6 +82,9 @@ impl Notification { }, Die{actor, target} => { format!("{} was killed by {}", target, actor) + }, + Options{description, options} => { + format!("{}. Options: {}", description, options.iter().map(|(command, desc)| format!("'{}': {};", command, desc)).collect::>().join(" ")) } }; (self.type_name(), body) -- cgit