|
Revision 72, 0.9 KB
(checked in by Seldaek, 5 years ago)
|
|
* Acronym : allowed <Nick>: ACRO?
* Daddy : added "I am your daddy, bitch!" 10% chance response (if curses is on)
* Logging : fixed "heard foo bar" triggering false positive heard answers, same for seen
* Url : caches 5 URLs now to avoid cross-bot flood
* phergie.ini : added global curses switch
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | require_once 'Phergie/Plugin/Abstract/Base.php'; |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | class Phergie_Plugin_Daddy extends Phergie_Plugin_Abstract_Base |
|---|
| 13 | { |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | public function onPrivmsg() |
|---|
| 21 | { |
|---|
| 22 | $bot = $this->getIni('nick'); |
|---|
| 23 | $text = $this->event->getArgument(1); |
|---|
| 24 | if (preg_match('/' . $bot . '\s*:?\s+?who\'?s your daddy\??/iAD', $text)) { |
|---|
| 25 | if($this->getIni('curses') === 'true' && rand(0,10) === 10) { |
|---|
| 26 | $this->doPrivmsg($this->event->getSource(), $this->event->getNick() . ': I am your daddy, bitch!'); |
|---|
| 27 | } else { |
|---|
| 28 | $this->doPrivmsg($this->event->getSource(), 'You\'re my daddy, ' . $this->event->getNick() . '!'); |
|---|
| 29 | } |
|---|
| 30 | } |
|---|
| 31 | } |
|---|
| 32 | } |
|---|