コード例 #1
0
ファイル: TextAbstract.php プロジェクト: erebot/api
 public function match(\Erebot\Interfaces\Event\Base\Generic $event)
 {
     if (!$event instanceof \Erebot\Interfaces\Event\Base\Text) {
         return false;
     }
     $prefix = $event->getConnection()->getConfig(null)->getMainCfg()->getCommandsPrefix();
     $result = $this->realMatch($prefix, $event->getText());
     if (!is_bool($result)) {
         throw new \Erebot\InvalidValueException('Invalid return value');
     }
     return $result;
 }