feat(core): permissions query, finish bots impl

This commit is contained in:
Paul Makles
2023-08-05 16:14:47 +01:00
parent 9f3c1036d0
commit a681df04bd
20 changed files with 481 additions and 173 deletions

View File

@@ -1,3 +1,5 @@
use std::fmt;
/// User's relationship with another user (or themselves)
pub enum RelationshipStatus {
None,
@@ -21,5 +23,11 @@ pub enum UserPermission {
Invite = 1 << 3,
}
impl fmt::Display for UserPermission {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::Debug::fmt(self, f)
}
}
impl_op_ex!(+ |a: &UserPermission, b: &UserPermission| -> u32 { *a as u32 | *b as u32 });
impl_op_ex_commutative!(+ |a: &u32, b: &UserPermission| -> u32 { *a | *b as u32 });