From dd3744b08887debba0d44fd0bceddef5f8ed1356 Mon Sep 17 00:00:00 2001 From: Zeyla Hellyer Date: Sat, 14 Jul 2018 20:00:08 -0700 Subject: [PATCH] Implement Mentionable for ChannelCategory --- src/model/misc.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/model/misc.rs b/src/model/misc.rs index 3eaea38ef70..f27b10c6ad0 100644 --- a/src/model/misc.rs +++ b/src/model/misc.rs @@ -31,11 +31,17 @@ impl Mentionable for Channel { Channel::Guild(ref x) => format!("<#{}>", x.with(|x| x.id.0)), Channel::Private(ref x) => format!("<#{}>", x.with(|x| x.id.0)), Channel::Group(ref x) => format!("<#{}>", x.with(|x| x.channel_id.0)), - Channel::Category(_) => panic!("Categories can't be mentioned"), + Channel::Category(ref x) => format!("<#{}>", x.with(|x| x.id.0)), } } } +impl Mentionable for ChannelCategory { + fn mention(&self) -> String { + format!("#{}", self.name) + } +} + impl Mentionable for CurrentUser { fn mention(&self) -> String { format!("<@{}>", self.id.0)