refactor: tests for more group routes

This commit is contained in:
Paul Makles
2023-09-22 19:04:17 +01:00
parent 25ae1555a2
commit 2fa5ac41ac
13 changed files with 607 additions and 69 deletions

View File

@@ -231,3 +231,16 @@ auto_derived!(
pub nsfw: Option<bool>,
}
);
impl Channel {
/// Get a reference to this channel's id
pub fn id(&self) -> &str {
match self {
Channel::DirectMessage { id, .. }
| Channel::Group { id, .. }
| Channel::SavedMessages { id, .. }
| Channel::TextChannel { id, .. }
| Channel::VoiceChannel { id, .. } => id,
}
}
}