Don't award XP in quarantine channels
This commit is contained in:
parent
090223388d
commit
ed93d60a69
|
|
@ -10,6 +10,7 @@ use manifold::models::user::UserInfo;
|
||||||
use manifold::schema::userinfo;
|
use manifold::schema::userinfo;
|
||||||
use poise::FrameworkContext;
|
use poise::FrameworkContext;
|
||||||
use poise::serenity_prelude::{Context, Mentionable, Message, RoleId};
|
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::xp as xp_table;
|
||||||
use crate::badgey::schema::*;
|
use crate::badgey::schema::*;
|
||||||
|
|
||||||
|
|
@ -135,7 +136,7 @@ impl Xp {
|
||||||
};
|
};
|
||||||
|
|
||||||
let valid = match xp.last_given_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
|
None => true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue