Skip to content

Commit

Permalink
Respond when /confess command has completed
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinegb committed Apr 14, 2024
1 parent cebce6b commit 364a3d2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/confess.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use poise::serenity_prelude::{ChannelId, ExecuteWebhook, Mentionable, Webhook};

use crate::{Context, Error};
use crate::{Context, Error, FloofEmoji};

/// Sends an anonymous message in the #confessional channel
#[poise::command(slash_command)]
pub(super) async fn confess(
ctx: Context<'_>,
#[description = "Your message to #confessional"] message: String,
) -> Result<(), Error> {
ctx.defer_ephemeral().await?;

let webhook = Webhook::from_url(ctx, &ctx.data().confessions_webhook_url).await?;

webhook
Expand All @@ -29,5 +31,11 @@ pub(super) async fn confess(
)
.await?;

ctx.say(format!(
"Your confession has been sent! {}",
FloofEmoji::FloofHappy,
))
.await?;

Ok(())
}

0 comments on commit 364a3d2

Please sign in to comment.