From f88e947391bdff0d4338049d687eef2459560595 Mon Sep 17 00:00:00 2001 From: wrk Date: Fri, 9 Jun 2023 02:17:46 +0200 Subject: [PATCH] Added ,stop cmd --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index af34c62..1ed4e23 100644 --- a/src/main.rs +++ b/src/main.rs @@ -234,7 +234,10 @@ async fn main() -> std::io::Result<()> { .add_system("h", show_help) .await .add_system("s", show_status) - .await; + .await + .add_system("stop", stop) + .await + ; irc.run().await?; Ok(()) @@ -532,6 +535,7 @@ fn show_help() -> impl IntoResponse { ",f ... vs ... | team battle", ",f ... | free for all", ",s | show the current fight status", + ",stop | stop the current fight", ",hof | hall of fame", ], ) @@ -544,3 +548,9 @@ fn show_status(fight: Res) -> impl IntoResponse { format!("{} fighters remaining", fight.fighters.len()) } + +fn stop(mut fight: ResMut) { + fight.fighters = vec![]; + fight.channel = "".to_owned(); + fight.status = FightStatus::Idle; +}