Assembla home | Assembla project page
 

Changeset 174

Show
Ignore:
Timestamp:
03/16/08 17:39:59 (8 months ago)
Author:
tobias382
Message:

Modified the Daddy plugin to access 'ya' as well as 'your' and to have the object of the phrase (e.g. 'daddy') be variable

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Phergie/Plugin/Daddy.php

    r74 r174  
    2222        $bot = $this->getIni('nick'); 
    2323        $text = $this->event->getArgument(1); 
    24         if (preg_match('/' . $bot . '\s*:?\s+?who\'?s your daddy\??/iAD', $text)) { 
     24        if (preg_match('/' . $bot . '\s*:?\s+?who\'?s y(?:our|a) ([^?]+)\??/iAD', $text, $m)) { 
    2525                if($this->getIni('curses') && rand(0,5) === 5) { 
    26                     $this->doPrivmsg($this->event->getSource(), $this->event->getNick() . ': I am your daddy, bitch!'); 
     26                    $this->doPrivmsg($this->event->getSource(), $this->event->getNick() . ': I am your ' . $m[1] . ', bitch!'); 
    2727                } else { 
    28                     $this->doPrivmsg($this->event->getSource(), 'You\'re my daddy, ' . $this->event->getNick() . '!'); 
     28                    $this->doPrivmsg($this->event->getSource(), 'You\'re my ' . $m[1] . ', ' . $this->event->getNick() . '!'); 
    2929                } 
    3030        }