11pub mod api;
22pub mod client;
3- mod commands;
3+ pub mod commands;
44
55use crate :: db:: notifications:: add_metadata;
66use crate :: db:: notifications:: { self , delete_ping, move_indices, record_ping, Identifier } ;
@@ -14,9 +14,10 @@ use crate::team_data::{people, teams};
1414use crate :: utils:: pluralize;
1515use crate :: zulip:: api:: { MessageApiResponse , Recipient } ;
1616use crate :: zulip:: client:: ZulipClient ;
17- use crate :: zulip:: commands:: { ChatCommand , LookupCmd , StreamCommand , WorkqueueCmd , WorkqueueLimit } ;
17+ use crate :: zulip:: commands:: {
18+ parse_no_color, ChatCommand , LookupCmd , StreamCommand , WorkqueueCmd , WorkqueueLimit ,
19+ } ;
1820use anyhow:: { format_err, Context as _} ;
19- use clap:: Parser ;
2021use rust_team_data:: v1:: TeamKind ;
2122use std:: fmt:: Write as _;
2223use subtle:: ConstantTimeEq ;
@@ -192,7 +193,7 @@ fn handle_command<'a>(
192193
193194 // Missing stream means that this is a direct message
194195 if message_data. stream_id . is_none ( ) {
195- let cmd = ChatCommand :: try_parse_from ( words) ?;
196+ let cmd = parse_no_color :: < ChatCommand , _ > ( words. into_iter ( ) ) ?;
196197 match cmd {
197198 ChatCommand :: Acknowledge { identifier } => {
198199 acknowledge ( & ctx, gh_id, ( & identifier) . into ( ) ) . await
@@ -218,7 +219,7 @@ fn handle_command<'a>(
218219 if cmd_index >= words. len ( ) {
219220 return Ok ( Some ( "Unknown command" . to_string ( ) ) ) ;
220221 }
221- let cmd = StreamCommand :: try_parse_from ( & words[ cmd_index..] ) ?;
222+ let cmd = parse_no_color :: < StreamCommand , _ > ( words[ cmd_index..] . into_iter ( ) . copied ( ) ) ?;
222223 match cmd {
223224 StreamCommand :: EndTopic => {
224225 post_waiter ( & ctx, message_data, WaitingMessage :: end_topic ( ) )
0 commit comments