File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -70,8 +70,10 @@ use crate::utils::write_json;
7070#[ derive( BotCommands , Clone , Debug ) ]
7171#[ command( rename_rule = "lowercase" , description = "Supported commands:" ) ]
7272enum BCommand {
73- #[ command( description = "main and the only command." ) ]
73+ #[ command( description = "main command." ) ]
7474 Notifier ( String ) ,
75+ #[ command( description = "shortcut for/notifier pr-add/issue-add." ) ]
76+ Add ( String ) ,
7577}
7678
7779#[ tokio:: main]
@@ -186,8 +188,11 @@ async fn version_check() -> Result<(), Error> {
186188async fn answer ( bot : Bot , msg : Message , bc : BCommand ) -> ResponseResult < ( ) > {
187189 log:: trace!( "message: {msg:?}" ) ;
188190 log:: trace!( "bot command: {bc:?}" ) ;
189- let BCommand :: Notifier ( input) = bc;
190- let result = match command:: parse ( input) {
191+ let cmd_str = match bc {
192+ BCommand :: Notifier ( input) => input,
193+ BCommand :: Add ( input) => format ! ( "pr-add {input}" ) ,
194+ } ;
195+ let result = match command:: parse ( cmd_str) {
191196 Ok ( command) => {
192197 log:: debug!( "command: {command:?}" ) ;
193198 let ( bot, msg) = ( bot. clone ( ) , msg. clone ( ) ) ;
You can’t perform that action at this time.
0 commit comments