Re-write notifications system.
This commit is contained in:
21
src/notifications/mod.rs
Normal file
21
src/notifications/mod.rs
Normal 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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user