other users can no longer interact with your game

This commit is contained in:
2025-04-01 23:33:57 -04:00
parent 132398cd53
commit 61859c04ef

View File

@@ -208,9 +208,12 @@ pub async fn blackjack(ctx: Context<'_>, amount: String) -> Result<(), Error>
msg.edit(ctx, reply).await?; msg.edit(ctx, reply).await?;
let author_id = ctx.author().id;
let Some(mci) = serenity::ComponentInteractionCollector::new(ctx.serenity_context()) let Some(mci) = serenity::ComponentInteractionCollector::new(ctx.serenity_context())
.timeout(Duration::from_secs(120)) .timeout(Duration::from_secs(120))
.filter(move |mci| mci.data.custom_id.starts_with("blackjack")).await else { .filter(move |mci| mci.data.custom_id.starts_with("blackjack")
&& mci.member.as_ref().unwrap().user.id == author_id).await else {
ctx.reply("failed interaction!").await?; ctx.reply("failed interaction!").await?;
return Ok(()); return Ok(());
}; };