Channel subscription, message sending, channel delete.

This commit is contained in:
Paul Makles
2021-01-18 14:50:17 +00:00
parent 15357008d6
commit 3d3db80e61
7 changed files with 139 additions and 4 deletions

View File

@@ -28,6 +28,14 @@ pub enum Channel {
}
impl Channel {
pub fn id(&self) -> &str {
match self {
Channel::SavedMessages { id, .. } => id,
Channel::DirectMessage { id, .. } => id,
Channel::Group { id, .. } => id,
}
}
pub async fn save(&self) -> Result<()> {
get_collection("channels")
.insert_one(