root/trunk/Phergie/Plugin/Daddy.php @ 60

Revision 60, 0.7 KB (checked in by tobias382, 5 years ago)

Fixes #1, #8, #14, #10, #13
* Fixed some parameter parsing issues in the streams driver and Command plugin
* Fixed an issue in the streams driver where quitting would not cause the

connection to be terminated on the client side

* Added automated directory creation to the event handler class
* Added isInChannel() and TYPE_KICK to request event class
* Modified the bootstrap file to use a full path when referencing the Plugin

directory and to include plugin loading debugging messages

* Fixed a bug in the bootstrap file where it would not produce an error when

required configuration settings existed, but were empty

* Cleared default values and unused settings out of the config file
* Made modifications to the fromAdmin method in the AdminCommand? plugin to

optimize performance

* Fixed a bug in the parsing logic in the Acronym plugin and added a check for

instances where the per-IP bandwidth limit has been executed

* Added a check for cases where a server has no MOTD to the Autojoin plugin
* Modified the Drink plugin to filter coffee drinks when scraping data for the

coke table and to remove the profanity filter array from memory once the
init method is done using it

* Added an avogadro alias for the mole fixed karma and added support for

configurable fixed karma for the bot

* Modified the Logging plugin to extend the Command plugin and to use PDO in

place of the standalone SQLite driver

* Modified the Php plugin to use full URLs to function pages rather than the

shorthand version, which does not always resolve to the expected URL

* Renamed the Say plugin to Puppet and added support emulation of CTCP ACTION

commands

* Modified the Url plugin to use the MIME type of the resource in place of

the title in cases where it is not HTML-based

* Fixed an issue with the parsing logic in the onMode handler of the Users

plugin

* Uncommented the onPrivmsg handler and modified it to use the new debug

configuration setting

* Added alternate nick support to the Nickserv plugin
* Removed the CONTRIBUTE file, as its fairly out of date

Line 
1<?php
2
3/**
4* @see Phergie_Event_Handler
5*/
6require_once 'Phergie/Event/Handler.php';
7
8/**
9* Simply responds to messages addressed to the bot that contain the phrase
10* "Who's your daddy?"
11*/
12class Phergie_Plugin_Daddy extends Phergie_Event_Handler
13{
14    /**
15    * Checks messages for the question to which it should respond and sends a
16    * response when appropriate
17    *
18    * @return void
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            $this->doPrivmsg($this->event->getSource(), 'You\'re my daddy, ' . $this->event->getNick() . '!');
26        }
27    }
28}
Note: See TracBrowser for help on using the browser.