Skip to content

Commit

Permalink
message the user when kicking or banning them
Browse files Browse the repository at this point in the history
  • Loading branch information
AsianIntel committed Nov 19, 2024
1 parent e5106f3 commit a212646
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions rowifi/src/commands/user/update/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,41 @@ Hey there, it looks like you're not verified with us. Please run `/verify` to re
DenyListActionType::None => {}
DenyListActionType::Kick => {
tracing::trace!("kicking them");
if let Ok(private_channel) =
bot.http.create_private_channel(member.id.0).await
{
if let Ok(private_channel) = private_channel.model().await {
let _ = bot
.http
.create_message(private_channel.id)
.content(&format!(
"You have been kicked from {}. Reason: {}",
server.name, deny_list.reason
))
.await;
}
}
let _ = bot
.http
.remove_guild_member(ctx.guild_id.0, member.id.0)
.await;
}
DenyListActionType::Ban => {
tracing::trace!("banning them");
if let Ok(private_channel) =
bot.http.create_private_channel(member.id.0).await
{
if let Ok(private_channel) = private_channel.model().await {
let _ = bot
.http
.create_message(private_channel.id)
.content(&format!(
"You have been banned from {}. Reason: {}",
server.name, deny_list.reason
))
.await;
}
}
let _ = bot.http.create_ban(ctx.guild_id.0, member.id.0).await;
}
}
Expand Down

0 comments on commit a212646

Please sign in to comment.