Fix refresh_non_members command

Add `defer` to prevent timeout
This commit is contained in:
Aadi Desai 2023-10-15 15:35:27 +01:00
parent 63c453d370
commit 6684bd1832
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM

View file

@ -94,6 +94,7 @@ pub(crate) async fn edit_member_fresher(
pub(crate) async fn refresh_non_members(ctx: ACtx<'_>) -> Result<(), Error> {
use serenity::futures::StreamExt;
tracing::info!("{}", ctx.author().name);
ctx.defer().await?;
let mut members = ctx.data().server.members_iter(ctx.http()).boxed();
let mut cnt = 0;
while let Some(Ok(mut m)) = members.next().await {