improved command manager

This commit is contained in:
kremsy
2013-12-09 22:20:30 +01:00
parent 67f468161e
commit 89ec2aa9a5
3 changed files with 22 additions and 21 deletions

View File

@ -78,15 +78,16 @@ class CommandManager implements CallbackListener {
return;
}
// Handle command
$command = explode(" ", substr($callback[1][2], 1));
$command = strtolower($command[0]);
$commandArray = explode(" ", substr($callback[1][2], 1));
$command = strtolower($commandArray[0]);
if(substr($command,0,1) == "/" || $command == "admin"){ //admin command
$commandListeners = $this->adminCommandListeners;
if($command == "admin"){
//TODO make /admin working
$command = strtolower($commandArray[1]);
}else{
$command = substr($command, 1); //remove /
}
$command = substr($command, 1);
}else{ //user command
$commandListeners = $this->commandListeners;
}