Remove old member role if present, else welcome

This commit is contained in:
Aadi Desai 2023-10-12 00:25:11 +01:00
parent 550080482c
commit 4a066e4f00
Signed by: supleed2
SSH key fingerprint: SHA256:CkbNRs0yVzXEiUp2zd0PSxsfRUMFF9bLlKXtE1xEbKM
3 changed files with 9 additions and 3 deletions

View file

@ -261,7 +261,9 @@ pub(crate) async fn login_6(
})
})
.await?;
if !mm.roles.contains(&data.old_member) {
if mm.roles.contains(&data.old_member) {
crate::verify::remove_role(ctx, &mut mm, data.old_member).await?;
} else {
crate::verify::welcome_user(&ctx.http, &data.gn_ch_id, &m.user, fresher)
.await?;
}

View file

@ -252,7 +252,9 @@ pub(crate) async fn manual_4(
})
})
.await?;
if !member.roles.contains(&data.old_member) {
if member.roles.contains(&data.old_member) {
crate::verify::remove_role(ctx, &mut member, data.old_member).await?;
} else {
crate::verify::welcome_user(&ctx.http, &data.gn_ch_id, &user, fresher).await?;
}
}

View file

@ -181,7 +181,9 @@ pub(crate) async fn membership_3(
})
})
.await?;
if !mm.roles.contains(&data.old_member) {
if mm.roles.contains(&data.old_member) {
crate::verify::remove_role(ctx, &mut mm, data.old_member).await?;
} else {
crate::verify::welcome_user(&ctx.http, &data.gn_ch_id, &m.user, fresher)
.await?;
}