If you want a simpler method, use the default variable/array $args. Since it is an array, get the first sub-command using the key 0 (Remember it starts with a 0). PHP: $args[0] Use switch-case or an if: PHP: switch(strtolower($args[0])){ case "help": break; case "blah": // ANYTHING break;}
Understand the code. Use the array $args. PHP: if($command->getName() == "mg"){ switch(strtolower($args[0])){ case "help": $sender->sendMessage("Hi"); break; }}