public class ExampleCommand : IConsoleCommand
{
public string CommandWord { get; } = "example";
public bool Process(string[] args)
{
//Run fancy code here!
//Make sure if the execution of your command was successfull => return true;
//else => return false;
//kind of like this:
if(args.Length == 0 || args == null)
{
MaumConsole.instance.Error("Missing Argument(s)", CommandWord);
return false; // This is optional. Just checking if user entered arguments!
}
if (args[0].Equals("pls", StringComparison.OrdinalIgnoreCase))
{
// yay the entered command was "[prefix][CommandWord] pls" and now i will help by sending some cool data > Debug.log();
MaumConsole.instance.Log("Yay you ran the example command!",CommandWord);
return true;
}
else
{
//oh no
MaumConsole.instance.Error("Wrong Argument(s)",CommandWord);
return false;
}
}
}
public class ExampleCommand : IConsoleCommand
{
public string CommandWord { get; } = "example";
public bool Process(string[] args)
{
//Run fancy code here!
//Make sure if the execution of your command was successfull => return true;
//else => return false;
//kind of like this:
if(args.Length == 0 || args == null)
{
MaumConsole.instance.Error("Missing Argument(s)", CommandWord);
return false; // This is optional. Just checking if user entered arguments!
}
if (args[0].Equals("pls", StringComparison.OrdinalIgnoreCase))
{
// yay the entered command was "[prefix][CommandWord] pls" and now i will help by sending some cool data > Debug.log();
MaumConsole.instance.Log("Yay you ran the example command!",CommandWord);
return true;
}
else
{
//oh no
MaumConsole.instance.Error("Wrong Argument(s)",CommandWord);
return false;
}
}
}