Added power level control to warn command

main
David 2023-01-09 08:32:08 +01:00
parent d958a2135d
commit 341821e63d
1 changed files with 4 additions and 1 deletions

View File

@ -338,9 +338,12 @@ pub mod bot {
dbg!(self.database_handle.get(words[2]).unwrap());
let (timestamp, mut reputation) =
convert_from_bytes_sled(&user_data.unwrap());
if words[1] == "warn" {
if words[1] == "warn" && member.power_level() >= 50 {
reputation -= 1
}
if words[1] == "warn" && member.power_level() < 50 {
self.send_message("This command is for moderators and admins only!").await;
}
if words[1] == "award" {
reputation += 1;
}