From f264793f68cb9dc8ce886f3004f5d89c9a1eebbc Mon Sep 17 00:00:00 2001 From: Urgau Date: Fri, 24 Oct 2025 22:00:23 +0200 Subject: [PATCH] Skip `@**triagebot**` when parsing Zulip command in a stream --- src/zulip.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/zulip.rs b/src/zulip.rs index 07404353..342360d0 100644 --- a/src/zulip.rs +++ b/src/zulip.rs @@ -282,6 +282,16 @@ async fn handle_command<'a>( continue; }; + // Skip @**triagebot** + let cmd_index = cmd_index + 1; + + // Error on unexpected end-of-line + if cmd_index >= words.len() { + return Ok(Some( + "Error parsing command: unexpected end-of-line".to_string(), + )); + } + let cmd = parse_cli::(words[cmd_index..].iter().copied())?; tracing::info!("command parsed to {cmd:?}");