Example #1
0
 /**
  * @param Message $message
  *
  * @return bool
  */
 public function match(Message $message)
 {
     $text = trim($message->getText());
     if (substr($text, 0, 1) == '/') {
         if (strpos($text, '@') > 0) {
             list($text, $to) = explode('@', $text, 2) + ['', ''];
             //@TODO check $to
         }
     }
     return $text === $this->expect;
 }
Example #2
0
 /**
  * @param Message $message
  *
  * @return bool
  */
 public function match(Message $message)
 {
     return (bool) preg_match($this->expect, trim($message->getText()));
 }