diff options
| author | troido <troido@protonmail.com> | 2020-04-21 18:14:52 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-21 18:14:52 +0200 |
| commit | 36dc11d82fdc7b5db965f0c33c1ee5da9aa1818c (patch) | |
| tree | b90286433f8d129db69d0dc15c213b938392cc65 /src/components/ear.rs | |
| parent | 99e3ad27e075ccf327d0f399bfa73d75be66d13d (diff) | |
added options notification
Diffstat (limited to 'src/components/ear.rs')
| -rw-r--r-- | src/components/ear.rs | 10 |
1 files changed, 9 insertions, 1 deletions
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::<Vec<String>>().join(" ")) } }; (self.type_name(), body) |
