Make exception for bot owner in NonNewAccountPermission

This commit is contained in:
2026-04-03 05:57:35 -03:00
parent b0a6950005
commit c9b81219e5
4 changed files with 6 additions and 7 deletions
+3 -4
View File
@@ -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(