Skip to content

Commit

Permalink
kickコマンド実装した
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna2134 committed Sep 5, 2023
1 parent d78359f commit e0b4ef5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,20 @@ async fn handle_event(
if let CommandOptionValue::User(userid) =
command.options.get(0).unwrap().value
{
let response = InteractionResponse {
kind: InteractionResponseType::DeferredChannelMessageWithSource,
data: None,
};
interaction_http
.create_response(interaction.id, &interaction.token, &response)
.await?;
client
.http
.remove_guild_member(interaction.guild_id.unwrap(), userid)
.await?;
let data = InteractionResponseDataBuilder::new()
.content("ユーザーをキックしました。".to_string())
.build();
let response = InteractionResponse {
kind: InteractionResponseType::ChannelMessageWithSource,
data: Some(data),
};
interaction_http
.create_response(interaction.id, &interaction.token, &response)
.create_followup(&interaction.token)
.content("<:ok_handbutflipped:779364331350523909>")?
.await?;
}
} else {
Expand Down

0 comments on commit e0b4ef5

Please sign in to comment.