@@ -124,7 +124,9 @@ public void Execute(string command, string[] args) =>
124124 /// </summary>
125125 /// <param name="command">The string to search command</param>
126126 /// <param name="args">The object array to pass as arguments</param>
127- public void Execute ( string command , object [ ] args ) =>
127+
128+ // Because of it's risk, We decided to change to internal.
129+ internal void Execute ( string command , object [ ] args ) =>
128130 FindCommand ( command ) . Execute ( args ) ;
129131
130132 /// <summary>
@@ -135,13 +137,13 @@ public void Execute(string command, object[] args) =>
135137 /// <returns>The class that has information of command</returns>
136138 public Command FindCommand ( string cmd )
137139 {
138- ( MethodInfo method , CommandModule module , var _ ) = FindCommand ( cmd , null ) ;
140+ ( MethodInfo method , CommandModule module ) = FindCommand ( cmd , null ) ;
139141
140142 Executor client = this ;
141143 return new Command ( ref client , module , method ) ;
142144 }
143145
144- internal ( MethodInfo Method , CommandModule Module , object [ ] Parameters ) FindCommand ( string command , string [ ] args )
146+ internal ( MethodInfo Method , CommandModule Module ) FindCommand ( string command , string _ )
145147 {
146148 MethodInfo method = null ;
147149 CommandModule module = null ;
@@ -174,20 +176,14 @@ public Command FindCommand(string cmd)
174176 }
175177
176178 if ( method == null || module == null )
177- throw new CommandNotFoundException ( new CommandRequest ( )
178- {
179- Command = command ,
180- Arguments = args
181- } ) ;
182-
183- object [ ] paras = ConvertParameter ( method , args ) ;
179+ throw new CommandNotFoundException ( command ) ;
184180
185- return ( method , module , paras . Any ( ) ? paras . ToArray ( ) : null ) ;
181+ return ( method , module ) ;
186182 }
187183
188184 internal object [ ] ConvertParameter ( MethodInfo method , string [ ] args )
189185 {
190- if ( args == null ) return Array . Empty < object > ( ) ;
186+ if ( args == null ) args = Array . Empty < string > ( ) ;
191187
192188 ParameterInfo [ ] paras = method . GetParameters ( ) ;
193189
0 commit comments