Make exception for bot owner in NonNewAccountPermission
This commit is contained in:
@@ -50,10 +50,9 @@ pub struct NonNewAccountPermission;
|
||||
#[async_trait]
|
||||
impl Permission<State, Extras> for NonNewAccountPermission {
|
||||
async fn check(&self, ctx: &CommandContext<State, Extras>) -> Result<bool, CommandError> {
|
||||
Ok(
|
||||
UtcDateTime::from_unix_timestamp(ctx.event.author.id.timestamp() / 1000).unwrap()
|
||||
< UtcDateTime::now() - Duration::days(30),
|
||||
)
|
||||
Ok(ctx.event.author.id.get() == ctx.rt.state.bot_owner_id
|
||||
|| UtcDateTime::from_unix_timestamp(ctx.event.author.id.timestamp() / 1000).unwrap()
|
||||
< UtcDateTime::now() - Duration::days(30))
|
||||
}
|
||||
|
||||
async fn on_handle_denied(
|
||||
|
||||
Reference in New Issue
Block a user