= Fixed choose to display help when there are no arguments provided
This commit is contained in:
@@ -19,7 +19,14 @@ public class CommandChoose extends Command
|
||||
@Override
|
||||
public void OnRun(KittyGuild guild, KittyChannel channel, KittyUser user, UserInput input, Response res)
|
||||
{
|
||||
if(input.args.trim().length() == 0)
|
||||
{
|
||||
res.Call(Stats.instance.GetHelpText(input.key));
|
||||
return;
|
||||
}
|
||||
|
||||
String [] choices = input.args.split(",");
|
||||
|
||||
if(choices.length == 1)
|
||||
{
|
||||
res.Call(LocStrings.Stub("ChooseOne"));
|
||||
|
||||
@@ -111,12 +111,12 @@ public class CommandManager
|
||||
}
|
||||
|
||||
// Looks up command by name. If it exists, dumps help text, otherwise returns null.
|
||||
public String GetCommandHelpText(String lookup)
|
||||
public String GetCommandHelpText(String key)
|
||||
{
|
||||
Command command = commands.get(lookup);
|
||||
Command command = commands.get(key);
|
||||
|
||||
if(command != null)
|
||||
return command.HelpText();
|
||||
return "`" + key + "`: " + command.HelpText();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user