]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Irc/extlib/phergie/Phergie/Plugin/Puppet.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / plugins / Irc / extlib / phergie / Phergie / Plugin / Puppet.php
1 <?php
2 /**
3  * Phergie 
4  *
5  * PHP version 5
6  *
7  * LICENSE
8  *
9  * This source file is subject to the new BSD license that is bundled
10  * with this package in the file LICENSE.
11  * It is also available through the world-wide-web at this URL:
12  * http://phergie.org/license
13  *
14  * @category  Phergie 
15  * @package   Phergie_Plugin_Puppet
16  * @author    Phergie Development Team <team@phergie.org>
17  * @copyright 2008-2010 Phergie Development Team (http://phergie.org)
18  * @license   http://phergie.org/license New BSD License
19  * @link      http://pear.phergie.org/package/Phergie_Plugin_Puppet
20  */
21
22 /**
23  * Allows a user to effectively speak and act as the bot.
24  *
25  * @category Phergie 
26  * @package  Phergie_Plugin_Puppet
27  * @author   Phergie Development Team <team@phergie.org>
28  * @license  http://phergie.org/license New BSD License
29  * @link     http://pear.phergie.org/package/Phergie_Plugin_Puppet
30  * @uses     Phergie_Plugin_Command pear.phergie.org
31  */
32 class Phergie_Plugin_Puppet extends Phergie_Plugin_Abstract
33 {
34     /**
35      * Checks for dependencies.
36      *
37      * @return void
38      */
39     public function onLoad()
40     {
41         $this->getPluginHandler()->getPlugin('Command');
42     }
43
44     /**
45      * Handles a request for the bot to repeat a given message in a specified
46      * channel.
47      *
48      * <code>say #chan message</code>
49      *
50      * @param string $channel Name of the channel
51      * @param string $message Message to repeat
52      *
53      * @return void
54      */
55     public function onCommandSay($channel, $message)
56     {
57         $this->doPrivmsg($channel, $message);
58     }
59
60     /**
61      * Handles a request for the bot to repeat a given action in a specified
62      * channel.
63      *
64      * <code>act #chan action</code>
65      *
66      * @param string $channel Name of the channel
67      * @param string $action  Action to perform
68      *
69      * @return void
70      */
71     public function onCommandAct($channel, $action)
72     {
73         $this->doAction($channel, $action);
74     }
75
76     /**
77      * Handles a request for the bot to send the server a raw message
78      *
79      * <code>raw message</code>
80      *
81      * @param string $message Message to send
82      *
83      * @return void
84      */
85     public function onCommandRaw($message)
86     {
87         $this->doRaw($message);
88     }
89 }