2 class sample
implements plugin
{
3 private $IRCConn,$formater;
6 public function __construct($main) {
7 $this->IRCConn
= bot
::GetInstance();
8 $this->formater
= text_format
::GetInstance();
11 public function commands_list() {
13 'method1' => array( // !sample method1
16 'help' => 'some help for this method1',
19 'method2' => array( // !sample method2 arg
22 // the \n chr in a double quote string create a new line (2 PRIVMSG)
23 'help' => "some help for this method2\n".$this->formater
->bold('one arg').' requier',
26 'method3' => array( // /msg BotName sample method3 arg
29 'help' => 'some help for this method3',
36 public function current_message ($message) {
37 /* gived by irc::parse_get
39 'type' => PRIVMSG|NOTICE,
40 'from' => Nick (reply to),
41 'to' => BotName / ChannelName,
42 'message' => The message
45 $this->message
= $message;
47 public function error($msg,$command) {}
50 $this->IRCConn
->privmsg(bot
::$channel,'This is the method1');
53 function method2 ($query) {
54 $this->IRCConn
->privmsg(bot
::$channel,'This is the method2 : '.$query);
57 function method3 ($query) {
59 if (bot
::$myBotName == $this->message
['to']) {
60 $replyto = $this->message
['from'];
62 $replyto = $this->message
['to'];
65 $this->IRCConn
->privmsg($replyto,'This is the method3 : '.$query);