From 679294f85bba790271ea3135142258a25222a3ed Mon Sep 17 00:00:00 2001 From: AXON Date: Mon, 6 Nov 2023 23:17:36 +0600 Subject: [PATCH] feat: Use ephemeral messages for bot button click responses --- src/event/interaction_create/question_thread_suggestions.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/event/interaction_create/question_thread_suggestions.rs b/src/event/interaction_create/question_thread_suggestions.rs index 9b998bc..a61a8f7 100644 --- a/src/event/interaction_create/question_thread_suggestions.rs +++ b/src/event/interaction_create/question_thread_suggestions.rs @@ -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, @@ -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| {