Skip to content

Commit

Permalink
feat: Use ephemeral messages for bot button click responses (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
axonasif committed Nov 6, 2023
1 parent 1d003c5 commit c06c711
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/event/interaction_create/question_thread_suggestions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ use serenity::{
client::Context,
model::{
application::{
component::ButtonStyle, interaction::message_component::MessageComponentInteraction,
interaction::InteractionResponseType,
component::ButtonStyle,
interaction::message_component::MessageComponentInteraction,
interaction::{InteractionResponseType, MessageFlags},
},
channel::ReactionType,
prelude::component::Button,
Expand Down Expand Up @@ -35,6 +36,7 @@ pub async fn responder(mci: &MessageComponentInteraction, ctx: &Context) -> Resu
mci.create_interaction_response(&ctx.http, |r| {
r.kind(InteractionResponseType::ChannelMessageWithSource)
.interaction_response_data(|d| {
d.flags(MessageFlags::EPHEMERAL);
d.content(format!("{}: {button_label}", &mci.user.mention()))
.components(|c| {
c.create_action_row(|a| {
Expand Down

0 comments on commit c06c711

Please sign in to comment.