Skip to content

Commit

Permalink
Implement Mentionable for ChannelCategory
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyla Hellyer committed Jul 15, 2018
1 parent 46c792c commit dd3744b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/model/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dd3744b

Please sign in to comment.