From 158cb5e8321ed30ed2ba1ee2374ed15e20d4ba27 Mon Sep 17 00:00:00 2001 From: ByteDice Date: Fri, 27 Feb 2026 22:35:33 +0100 Subject: [PATCH] made wwrps send results in both players' channels --- src/cmds/wwrps.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cmds/wwrps.rs b/src/cmds/wwrps.rs index 2a41707..ef04894 100644 --- a/src/cmds/wwrps.rs +++ b/src/cmds/wwrps.rs @@ -19,6 +19,7 @@ pub enum RPS { pub struct RPSPlayer { pub selection: RPS, pub user: User, + pub wwrps_channel: ChannelId, pub anonymous: bool } pub struct RPSGame { @@ -103,7 +104,7 @@ pub async fn cmd( if !game.is_full_lobby() { let r = game.add_player( - RPSPlayer { selection, user: ctx.author().clone(), anonymous }); + RPSPlayer { selection, user: ctx.author().clone(), wwrps_channel: ChannelId::new(c), anonymous }); if let Err(_) = r { send_msg(ctx, lang!("dc_msg_wwrps_already_submitted"), true, true).await; return Ok(()); } @@ -114,7 +115,10 @@ pub async fn cmd( let r_text = results_text(&game); game.clear(); - http_send_msg(ctx.http(), ChannelId::new(c), r_text).await; + for player in &game.players { + if let Some(p) = player + { http_send_msg(ctx.http(), p.wwrps_channel, r_text.clone()).await; } + } } return Ok(());