Don't award XP in quarantine channels #10

Merged
xyon merged 1 commits from feature/no-xp-in-quarantine-channels into main 2024-10-13 14:44:11 +00:00
1 changed files with 2 additions and 1 deletions
Showing only changes of commit 090223388d - Show all commits

View File

@ -10,6 +10,7 @@ use manifold::models::user::UserInfo;
use manifold::schema::userinfo;
use poise::FrameworkContext;
use poise::serenity_prelude::{Context, Mentionable, Message, RoleId};
use crate::badgey::models::quarantine_channel::QuarantineChannel;
use crate::badgey::schema::xp as xp_table;
use crate::badgey::schema::*;
@ -135,7 +136,7 @@ impl Xp {
};
let valid = match xp.last_given_xp {
Some(t) => (chrono::Utc::now().timestamp() - 60) > t,
Some(t) => (chrono::Utc::now().timestamp() - 60) > t && QuarantineChannel::get(&fctx.user_data.database, msg.channel_id.as_u64().clone() as i64).is_err(),
None => true
};