<?PHP
/**
* IamOP Plugin
*
* @version 0.3
* @author Max Rosan <hide@address.com>
*
* This file is part of maxIrcBot.
*
* maxIrcBot is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* maxIrcBot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
class plugin_IamOP {
private $maxIrcBot;
/**
* @return void
* @param maxIrcBot $clss
* @desc Construtor
*/
public function __construct(maxIrcBot &$clss) {
$this->maxIrcBot = &$clss;
}
/**
* @return void
* @param String $topic
* @param String $channel
* @desc Muda tópico do canal - it sets a new topic for a channel
*/
public function setTopic($topic, $channel) {
$this->maxIrcBot->write('TOPIC ' . $channel . ' ' . $topic);
}
/**
* @return void
* @param String $mode
* @param String $user
* @param String $channel
* @desc Indica modo de um usuário - it sets a mode of a user
*/
public function setMode($mode, $user, $channel) {
$this->maxIrcBot->write('MODE ' . $channel . ' ' . $mode . ' ' . $user);
}
/**
* @return void
* @param String $user
* @param String $pass
* @desc O bot passa a ter privilégios de operador - the bot obtains OP privileges
*/
public function obtainOPrivileges($user, $pass) {
$this->maxIrcBot->write('OPER ' . $user . ' ' . $pass);
}
/**
* @return void
* @param String $user
* @param String $channel
* @param String $msg
* @desc Expulsar um usuário de uma canal - the bot kicks a user
*/
public function kick($user, $channel, $msg = '') {
$this->maxIrcBot->write('KICK ' . $channel . ' ' . $user . ' :=>' . $msg);
}
}
?>