From 4de5082f6163e8b9e9988f4676bcde3a40be3044 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 2 Nov 2026 15:23:48 +0100 Subject: say: post text as a normal message after an invisible ack Acknowledge the interaction with a zero-width ephemeral reply, delete it, then send the text through ChannelId::say so it lands as a normal channel message instead of an interaction reply. --- src/commands/utilities.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/commands/utilities.rs b/src/commands/utilities.rs index 25d4bcf..7679b14 100644 --- a/src/commands/utilities.rs +++ b/src/commands/utilities.rs @@ -976,13 +976,21 @@ pub async fn message_download(ctx: Context<'_>, message: serenity::Message) -> R /// Echo text to channel #[poise::command(slash_command)] pub async fn say(ctx: Context<'_>, #[description = "Message to send"] text: String) -> Result<()> { - ctx.say(&text).await?; - ctx.send( - poise::CreateReply::default() - .content("\u{200b}") - .ephemeral(true), - ) - .await?; + // Acknowledge the interaction with an invisible ephemeral reply, delete it, + // then post the actual text as a normal channel message (not a reply to the + // command invocation). + let ack = ctx + .send( + poise::CreateReply::default() + .content("\u{200b}") + .ephemeral(true), + ) + .await?; + ack.delete(ctx).await?; + + ctx.channel_id() + .say(ctx.serenity_context(), &text) + .await?; Ok(()) } -- cgit v1.2.3