@@ -4,13 +4,13 @@ use crate::config::Config;
44use crate :: db:: thread_exists;
55use crate :: errors:: CommandError :: InvalidFormat ;
66use crate :: errors:: ThreadError :: NotAThreadChannel ;
7- use crate :: errors:: { common , CommandError , ModmailError , ModmailResult } ;
7+ use crate :: errors:: { CommandError , ModmailError , ModmailResult , common } ;
88use crate :: i18n:: get_translated_message;
99use crate :: utils:: command:: defer_response:: defer_response;
1010use crate :: utils:: message:: message_builder:: MessageBuilder ;
1111use serenity:: all:: {
12- CommandDataOptionValue , CommandInteraction , CommandOptionType , Context , CreateCommand ,
13- CreateCommandOption , ResolvedOption ,
12+ CommandDataOptionValue , CommandInteraction , CommandOptionType , CommandType , Context ,
13+ CreateCommand , CreateCommandOption , ResolvedOption ,
1414} ;
1515use std:: collections:: HashMap ;
1616
@@ -52,6 +52,7 @@ impl RegistrableCommand for AddStaffCommand {
5252 CreateCommandOption :: new( CommandOptionType :: User , "user_id" , user_id_desc)
5353 . required( true ) ,
5454 ) ,
55+ CreateCommand :: new( "add_staff" ) . kind( CommandType :: User ) ,
5556 ]
5657 } )
5758 }
@@ -89,7 +90,15 @@ impl RegistrableCommand for AddStaffCommand {
8990 ) ) ) ;
9091 }
9192 } ,
92- None => return Err ( ModmailError :: Command ( CommandError :: MissingArguments ) ) ,
93+ None => {
94+ if let Some ( user_id) = command. data . target_id {
95+ user_id. to_user_id ( )
96+ } else {
97+ return Err ( ModmailError :: Command ( CommandError :: InvalidArguments (
98+ "user_id" . to_string ( ) ,
99+ ) ) ) ;
100+ }
101+ }
93102 } ;
94103
95104 if thread_exists ( command. user . id , pool) . await {
0 commit comments