diff options
| author | Zeyla Hellyer <[email protected]> | 2018-07-14 20:00:08 -0700 |
|---|---|---|
| committer | Zeyla Hellyer <[email protected]> | 2018-07-14 20:07:45 -0700 |
| commit | dd3744b08887debba0d44fd0bceddef5f8ed1356 (patch) | |
| tree | a26f2cd518b37f53d10514faff884ead7f0e4a30 /src | |
| parent | Quickly rename to `no_dm_prefix` (diff) | |
| download | serenity-dd3744b08887debba0d44fd0bceddef5f8ed1356.tar.xz serenity-dd3744b08887debba0d44fd0bceddef5f8ed1356.zip | |
Implement Mentionable for ChannelCategory
Diffstat (limited to 'src')
| -rw-r--r-- | src/model/misc.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/model/misc.rs b/src/model/misc.rs index 3eaea38..f27b10c 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) |