Assembla home | Assembla project page
 

root/trunk/Phergie/Plugin/Puppet.php

Revision 223, 1.5 kB (checked in by Slynderdale, 6 months ago)

Various bug fixes and enhancements:

Notable Changes:

  • Bot.php: The auto loader now strips out the "Phergie_" prefix from class names while getting the path to the class file to include for those who don't have the bot in a directory called Phergie. Both the Phergie directory and the parent directory were added to the include path. Also added a check to see if they have a timezone is set in PHP.ini, if not, set the timezone to the default timezone to prevent strict errors while using date.
  • Streams.php: Added support for invite requests and also fixed a small bug where an empty command gets ent to call_user_func due to a packet getting cut off.
  • Base.php: Added onInvite and changed fromAdmin so the first argunent needs to be set to true for hostmask admin checking.
  • Lart.php: Improved lart a bit and fixed bugs where you couldn't remove certain terms due to spacing/character casing issues
  • Seen.php: Added a quote command to get a random quote by a specified user
  • Users.php: Renamed Users to ServerInfo to prepare it for future changes to make it store more information about users, channels and the server. Also fixed a bug where halfops and voiced users were considered an OP.
Line 
1 <?php
2
3 /**
4  * Allows administrators to effectively speak and act as the bot.
5  */
6 class Phergie_Plugin_Puppet extends Phergie_Plugin_Abstract_Command
7 {
8     /**
9      * Flag indicating whether or not the plugin is an admin plugin or not
10      *
11      * @var bool
12      */
13     public $needsAdmin = true;
14
15     /**
16      * Handles a request for the bot to repeat a given message in a specified
17      * channel.
18      *
19      * <code>say #chan message</code>
20      *
21      * @param string $chan Name of the channel
22      * @param string $message Message to repeat
23      * @return void
24      */
25     public function onDoSay($chan, $message)
26     {
27         $this->doPrivmsg($chan, $message);
28     }
29
30     /**
31      * Handles a request for the bot to repeat a given action in a specified
32      * channel.
33      *
34      * <code>act #chan action</code>
35      *
36      * @param string $chan Name of the channel
37      * @param string $action Action to perform
38      * @return void
39      */
40     public function onDoAct($chan, $action)
41     {
42         $this->doAction($chan, $action);
43     }
44
45     /**
46      * Handles a request for the bot to send the server a raw message
47      *
48      * <code>raw message</code>
49      *
50      * @param string $message Message to send
51      * @return void
52      */
53     public function onDoRaw($message)
54     {
55         $user = $this->event->getNick();
56         if ($this->fromAdmin(true)) {
57             $this->doRaw($message);
58         } else {
59             $this->doNotice($user, 'You do not have permission to send raw messages.');
60         }
61     }
62 }
63
Note: See TracBrowser for help on using the browser.