File tree Expand file tree Collapse file tree
rustmail/src/commands/reply Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,6 +60,15 @@ impl RegistrableCommand for ReplyCommand {
6060 None ,
6161 )
6262 . await ;
63+ let snippet_desc = get_translated_message (
64+ & config,
65+ "slash_command.reply_snippet_argument_description" ,
66+ None ,
67+ None ,
68+ None ,
69+ None ,
70+ )
71+ . await ;
6372 let anonymous_desc = get_translated_message (
6473 & config,
6574 "slash_command.reply_anonymous_argument_description" ,
@@ -85,7 +94,7 @@ impl RegistrableCommand for ReplyCommand {
8594 CreateCommandOption :: new(
8695 CommandOptionType :: String ,
8796 "snippet" ,
88- "Use a snippet instead of typing a message" ,
97+ snippet_desc ,
8998 )
9099 . required( false ) ,
91100 )
@@ -157,8 +166,8 @@ impl RegistrableCommand for ReplyCommand {
157166 content = Some ( snippet. content ) ;
158167 }
159168 None => {
160- return Err ( ModmailError :: Command ( CommandError :: CommandFailed (
161- format ! ( "Snippet '{}' not found" , key) ,
169+ return Err ( ModmailError :: Command ( CommandError :: SnippetNotFound (
170+ key. to_string ( ) ,
162171 ) ) ) ;
163172 }
164173 }
Original file line number Diff line number Diff line change @@ -31,9 +31,9 @@ pub async fn reply(
3131 content = Some ( snippet. content ) ;
3232 }
3333 None => {
34- msg . reply ( & ctx . http , format ! ( "❌ Snippet `{}` not found." , snippet_key ) )
35- . await ? ;
36- return Ok ( ( ) ) ;
34+ return Err ( ModmailError :: Command ( CommandError :: SnippetNotFound (
35+ snippet_key . to_string ( ) ,
36+ ) ) ) ;
3737 }
3838 }
3939 }
You can’t perform that action at this time.
0 commit comments