- if (preg_match($pattern, $message)
- && $fact = $this->getChayism()
- ) {
- $this->doPrivmsg($source, 'Fact: ' . $fact);
- }
- }
-
- /**
- * Parses incoming CTCP request for "Terry Chay" and related variations
- * and responds with a chayism.
- *
- * @return void
- */
- public function onCtcp()
- {
- $event = $this->getEvent();
- $source = $event->getSource();
- $ctcp = $event->getArgument(1);
-
- if (preg_match('({terry[\s_+-]*chay}|tychay)ix', $ctcp)
- && $fact = $this->getChayism()
- ) {
- $this->doCtcpReply($source, 'TERRYCHAY', $fact);
+ if (preg_match($pattern, $message)) {
+ if($fact = $this->getChayism()) {
+ $this->doPrivmsg($source, 'Fact: ' . $fact);
+ }