feat: send new members instructions to link wolves #19

Merged
silver merged 20 commits from new-member-message into main 2024-09-17 21:33:22 +00:00
Showing only changes of commit 7ed20108fb - Show all commits

View file

@ -31,7 +31,7 @@ impl EventHandler for Handler {
Some(x) => x,
};
if let Ok(get_server_member) = get_server_member(&db, &new_member.guild_id, &new_member).await {
if get_server_member(&db, &new_member.guild_id, &new_member).await.is_ok() {
let mut roles = vec![];
if let Some(role) = &config.role_past {
@ -49,17 +49,15 @@ impl EventHandler for Handler {
if let Err(e) = new_member.add_roles(&ctx, &roles).await {
println!("{:?}", e);
}
} else {
if let Some(name) = new_member.guild_id.name(&ctx) {
let msg = format!(
"Welcome to the {} server! \n\
Sign up on ulwolves and go to #bot_commands and do /link_wolves to get full access",
name
);
} else if let Some(name) = new_member.guild_id.name(&ctx) {
let msg = format!(
"Welcome to the {} server! \n\
Sign up on ulwolves and go to #bot_commands and do /link_wolves to get full access",
name
);
if let Err(err) = new_member.user.direct_message(&ctx, |m| m.content(&msg)).await {
dbg!(err);
}
if let Err(err) = new_member.user.direct_message(&ctx, |m| m.content(&msg)).await {
dbg!(err);
}
}
}