feat: send new members instructions to link wolves
This commit is contained in:
parent
8ba92cc47e
commit
c63945bb86
2 changed files with 815 additions and 629 deletions
1430
Cargo.lock
generated
1430
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
14
src/main.rs
14
src/main.rs
|
@ -31,7 +31,7 @@ impl EventHandler for Handler {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
};
|
};
|
||||||
|
|
||||||
if get_server_member(&db, &new_member.guild_id, &new_member).await.is_ok() {
|
if let Ok(get_server_member) = get_server_member(&db, &new_member.guild_id, &new_member).await {
|
||||||
let mut roles = vec![];
|
let mut roles = vec![];
|
||||||
|
|
||||||
if let Some(role) = &config.role_past {
|
if let Some(role) = &config.role_past {
|
||||||
|
@ -49,6 +49,18 @@ impl EventHandler for Handler {
|
||||||
if let Err(e) = new_member.add_roles(&ctx, &roles).await {
|
if let Err(e) = new_member.add_roles(&ctx, &roles).await {
|
||||||
println!("{:?}", e);
|
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
|
||||||
|
);
|
||||||
|
|
||||||
|
if let Err(err) = new_member.user.direct_message(&ctx, |m| m.content(&msg)).await {
|
||||||
|
dbg!(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue