Hi D,
Custom commands can be added to the lib/class/CustomAJAXChat.php file.
All of the overrides need to go BETWEEN
class CustomAJAXChat extends AJAXChat {
and the closing bracket at the bottom of the file
}
The block of code below is what I have on my site. It adds the /away /online functionality from the GitHub Wiki, as well as some custom commands /slap and /status.
If you look at /slap and /status I think that will get you closer to what you are looking for.
// This is where we can start adding custom commands
function parseCustomCommands($text, $textParts) {
switch($textParts[0]) {
// Away from keyboard message:
case '/away':
$this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to Away');
$this->setUserName($this->getLoginUserName().'[Away]');
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
case '/online':
case '/back':
$this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to Online');
$this->setUserName($this->getLoginUserName());
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
case '/trout':
case '/slap':
$this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' slaps '.implode(' ', array_slice($textParts, 1)).' with a wet trout');
return true;
case '/status':
$this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to '.implode(' ', array_slice($textParts, 1)));
$this->setUserName($this->getLoginUserName().'['.implode(' ', array_slice($textParts, 1)).']');
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
} // End of switch
} // End of parseCustomCommands