mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-25 01:30:50 +00:00
Implement roles
management (#18)
Fix formatting Implement `roles` management Add a 'roles' mod and DB
This commit is contained in:
parent
99c7888dfb
commit
5dd26d7474
4 changed files with 250 additions and 1 deletions
|
@ -8,6 +8,9 @@ use youmubot_db::{GuildMap, DB};
|
|||
/// A list of SoftBans for all servers.
|
||||
pub type SoftBans = DB<GuildMap<ServerSoftBans>>;
|
||||
|
||||
/// A list of assignable roles for all servers.
|
||||
pub type Roles = DB<GuildMap<HashMap<RoleId, Role>>>;
|
||||
|
||||
/// For the admin commands:
|
||||
/// - Each server might have a `soft ban` role implemented.
|
||||
/// - We allow periodical `soft ban` applications.
|
||||
|
@ -34,3 +37,10 @@ pub struct ImplementedSoftBans {
|
|||
/// List of all to-unban people.
|
||||
pub periodical_bans: HashMap<UserId, DateTime<Utc>>,
|
||||
}
|
||||
|
||||
/// Role represents an assignable role.
|
||||
#[derive(Serialize, Deserialize, Debug, Clone)]
|
||||
pub struct Role {
|
||||
pub id: RoleId,
|
||||
pub description: String,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue