Merge in Phergie changes

This commit is contained in:
Luke Fitzgerald
2010-08-04 16:02:24 -07:00
parent 65a741cce2
commit cb34d95197
35 changed files with 1646 additions and 748 deletions

View File

@@ -1,6 +1,6 @@
<?php
/**
* Phergie
* Phergie
*
* PHP version 5
*
@@ -11,7 +11,7 @@
* It is also available through the world-wide-web at this URL:
* http://phergie.org/license
*
* @category Phergie
* @category Phergie
* @package Phergie_Plugin_Daddy
* @author Phergie Development Team <team@phergie.org>
* @copyright 2008-2010 Phergie Development Team (http://phergie.org)
@@ -23,7 +23,7 @@
* Simply responds to messages addressed to the bot that contain the phrase
* "Who's your daddy?" and related variations.
*
* @category Phergie
* @category Phergie
* @package Phergie_Plugin_Daddy
* @author Phergie Development Team <team@phergie.org>
* @license http://phergie.org/license New BSD License
@@ -45,15 +45,11 @@ class Phergie_Plugin_Daddy extends Phergie_Plugin_Abstract
$text = $event->getArgument(1);
$target = $event->getNick();
$source = $event->getSource();
$pattern
= '/' . preg_quote($prefix) .
$pattern
= '/' . preg_quote($prefix) .
'\s*?who\'?s y(?:our|a) ([^?]+)\??/iAD';
if (preg_match($pattern, $text, $m)) {
if ($config['daddy.curses'] && mt_rand(0, 5) === 5) {
$msg = $target . ': I am your ' . $m[1] . ', bitch!';
} else {
$msg = 'You\'re my ' . $m[1] . ', ' . $target . '!';
}
$msg = 'You\'re my ' . $m[1] . ', ' . $target . '!';
$this->doPrivmsg($source, $msg);
}
}