2011-12-13 22:10:29 +00:00
|
|
|
<?php
|
|
|
|
namespace wcf\system\chat\commands;
|
|
|
|
use \wcf\util\StringUtil;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inserts a message.
|
|
|
|
*
|
|
|
|
* @author Tim Düsterhus
|
2012-01-28 16:50:33 +00:00
|
|
|
* @copyright 2010-2012 Tim Düsterhus
|
2011-12-13 22:10:29 +00:00
|
|
|
* @license Creative Commons Attribution-NonCommercial-ShareAlike <http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode>
|
|
|
|
* @package timwolla.wcf.chat
|
|
|
|
* @subpackage system.chat.commands
|
|
|
|
*/
|
|
|
|
class ChatCommandHandler {
|
|
|
|
const COMMAND_CHAR = '/';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks whether the given text is a command.
|
|
|
|
*
|
|
|
|
* @param string $text
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
public function isCommand($text) {
|
|
|
|
return StringUtil::substring($text, 0, StringUtil::length(static::COMMAND_CHAR)) == static::COMMAND_CHAR;
|
|
|
|
}
|
|
|
|
}
|