Re-write notifications system.

This commit is contained in:
Paul Makles
2020-04-13 16:04:41 +01:00
parent 4fbd6c816d
commit 577f25642e
10 changed files with 506 additions and 211 deletions

21
src/notifications/mod.rs Normal file
View File

@@ -0,0 +1,21 @@
pub mod events;
pub mod pubsub;
pub mod state;
pub mod ws;
pub fn send_message<U: Into<Option<Vec<String>>>, G: Into<Option<String>>>(
users: U,
guild: G,
data: events::Notification,
) -> bool {
let users = users.into();
let guild = guild.into();
if pubsub::send_message(users.clone(), guild.clone(), data) {
state::send_message(users, guild, "bruh".to_string());
true
} else {
false
}
}