Switch to async-std, refractor notifications code.

This commit is contained in:
Paul Makles
2020-12-28 17:52:22 +00:00
parent 6253a91276
commit c748b4349b
16 changed files with 498 additions and 809 deletions

View File

@@ -0,0 +1,67 @@
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone)]
#[serde(tag = "type")]
pub enum Notification {
MessageCreate {
id: String,
nonce: Option<String>,
channel: String,
author: String,
content: String,
},
MessageEdit {
id: String,
channel: String,
author: String,
content: String,
},
MessageDelete {
id: String,
},
GroupUserJoin {
id: String,
user: String,
},
GroupUserLeave {
id: String,
user: String,
},
GuildUserJoin {
id: String,
user: String,
},
GuildUserLeave {
id: String,
user: String,
banned: bool,
},
GuildChannelCreate {
id: String,
channel: String,
name: String,
description: String,
},
GuildChannelDelete {
id: String,
channel: String,
},
GuildDelete {
id: String,
},
UserRelationship {
id: String,
user: String,
status: i32,
}
}