add / modify copyright notice
[irbot.git] / plugins / sample / method1.php
blob816cb0d8ec9ca743a1d97383c66bbf38a945897f
1 <?php
2 /**
3 * This file is part of IrBot, irc robot.
4 * Copyright (C) 2007-2008 Bellière Ludovic
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 /**
22 * @see Plugins_Command_Abstract
24 require_once(BASE_DIR.'Plugins/Command/Abstract.php');
26 class Plugin_Sample_Method1 extends Plugins_Command_Abstract {
28 protected $_ircmain;
30 public function __construct(Plugins_Abstract $plugin,IRCMain $ircmain) {
31 parent::__construct($plugin);
32 $this->_ircmain = $ircmain;
33 $this->_helpMessage = 'some help for this method1';
35 $options = array(
36 self::REQUIERED_ARGS => 0,
37 self::ACCEPTED_ARGS => 0,
38 self::COMMAND_VISIBILITY => self::TYPE_PUBLIC
41 self::setOptions($options);
45 public function doAction() {
46 if ($this->_event->isForChannel()) {
47 $this->ircmain->privmsg($this->_event->getDataFor(),'This is the method1');
48 } else {
49 $this->ircmain->privmsg($this->_event->getDataFor(),'Sorry, but this command is for public channel only.');
53 public function getType() {
54 return $this->_defaults[self::COMMAND_VISIBILITY];
57 public function __toString() {
58 return "method1";