Logo classes.scriptsphp.org PHP

go to nav bar

Bot IRC - Documentation plugins

Plugin plug_BotSpeek

Permet de faire parler le bot.


Description

Ce plugin permet de faire parler le Bot.
La commande doit être envoyée en privée au bot.


Utilisation.

Commandes op�rateurs :

  • !botspeek <[/me | /notice]texte > :: Envoie le texte sur le chan avec /me ou /notice si indiqué suivi du texte. Exemples : - !botspeek je parle - !botspeek /me s'ennuie
go to the top

Source du plugin.

<?php
/**
 * fichier : plug_BotSpeek.php : 
 * plugin permettant de faire parler le bot
 *
 * @package Cspbot
 * @since 2006/08/17
 * @version 0.3
 * @author Fabrice Lezoray - Tetsuo - Alain Nicolas (mcAllan)
 * @copyright See licence.txt
 * 
 */

class plug_BotSpeek extends plugin {
    
    
/**
     * IRCMain object
     * @var object IRCMain
     */
    
private $main;
        
    
/**
     * Constructor
     *
     * @param IRCMain main
     * 
     */
    
public function __construct($main) {
        
$this->main $main;
    }
    
    
/**
     * Start run plugin
     * 
     */
    
public function start() {
        
$this->BotSpeek();
    }

    
/**
     * Speek functions
     * 
     */
    
private function BotSpeek() {
        
        if(
preg_match('`^\!botspeek /me (.+)`i'$this->main->mess$T)) {
            if(
$this->main->type == 'PRIVATE' && $this->main->isBotOp($this->main->from)){
                
$this->main->Action($T[1]);
            }
        }
        elseif(
preg_match('`^\!botspeek /notice (.+)`i'$this->main->mess$T)) {
            if(
$this->main->type == 'PRIVATE' && $this->main->isBotOp($this->main->from)){
                
$this->main->sendNotice($T[1]);
            }
        }elseif(
preg_match('`^\!botspeek (.+)`i'$this->main->mess$T)) {
            if(
$this->main->type == 'PRIVATE' && $this->main->isBotOp($this->main->from)){
                
$this->main->sendMsg($T[1]);
            }
        }
    }
    
}

?>
go to the top

Merci de ne pas suivre ce lien emails.

0.0884s | «»
PHP powered