/** * Test the event against the trigger to check if the operation is to be fired. * @return <code>true</code> if the operation did trigger, <code>false</code> otherwise. */ public final function isTriggered(BotEvent $event) { $match = array(); $message = $event->getMessage(); if (preg_match("#^(\\s*" . $this->trigger . "(\\s+|\$))#i", $message, $match)) { $message = substr($message, strlen($match[1])); $event->setMessage($message); return true; } return false; }