fix: only current uses are activated
This commit is contained in:
parent
3cf298f137
commit
5f9037c69b
4 changed files with 79 additions and 2 deletions
|
@ -7,7 +7,7 @@ use serenity::{
|
|||
},
|
||||
Client,
|
||||
};
|
||||
use skynet_discord_bot::{db_init, get_config, get_server_config_bulk, Accounts, Config, DataBase, Servers};
|
||||
use skynet_discord_bot::{db_init, get_config, get_server_config_bulk, Accounts, Config, DataBase, Servers, get_now_iso};
|
||||
use sqlx::{Pool, Sqlite};
|
||||
use std::{process, sync::Arc};
|
||||
use tokio::sync::RwLock;
|
||||
|
@ -136,10 +136,11 @@ async fn get_server_member_bulk(db: &Pool<Sqlite>, server: &GuildId) -> Vec<Acco
|
|||
r#"
|
||||
SELECT *
|
||||
FROM accounts
|
||||
WHERE server = ? AND discord IS NOT NULL
|
||||
WHERE server = ? AND discord IS NOT NULL AND expiry > ?
|
||||
"#,
|
||||
)
|
||||
.bind(*server.as_u64() as i64)
|
||||
.bind(get_now_iso(true))
|
||||
.fetch_all(db)
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue