Bot talk

Back to Module Requests

Page: 1  
From User Message Body
lpreams
Post #770
user avatar
Member
Date: 8:59 pm, Jul 29 2008
Posts: 8


Have a module where users can pm the bot and tell it to say/act something in a channel.

-Phoenix

Even a clock that does not work is right twice a day.
Polish Proverb
hery
Post #811
Member
Date: 10:10 am, Sep 26 2008
Posts: 15


Writting it on the fly

bottalk.conf

Code

file    bottalk modules/bottalk/bottalk.php
priv    !say    true    true    true    0    bottalk reply


bottalk.php

Code

<?php

class bottalk extends module {

    public $title = "Make bot say anything";
    public $author = "hery";
    public $version = "0.9";

    public function reply($line, $args)
    {
        $chan = "";
        $query = "";
        if ($args['nargs'] == 0)
        {
            $this->ircClass->notice($line['fromNick'], "What do you make me say?");
            return;
        }
        
        if ($line['to'] == $this->ircClass->getNick())
        {
            if (substr($args['arg1'], 0, 1) == '#')
            {
                $chan = $args['arg1'];
                $query = trim(substr($args['query'], (strpos($args['query'], $args['arg1'])) + (strlen($args['arg1']))));
            }
            else
            {
                $this->ircClass->notice($line['fromNick'], "Where should I say that? Please use " . BOLD . "!say #channel word to say");
                return;
            }
        }
        else
        {
            $chan = $line['to'];
            $query = $args['query'];
        }
        
        $this->ircClass->privMsg($chan, $query);
        return;
    }

}
?>



didn't test it yet but it should be ok

hery
Post #814
Member
Date: 10:41 am, Sep 26 2008
Posts: 15


http://phpbots.org/modinfo.php?mod=41

You cannot send message from exernally...

backdawn
Post #1073
Member
Date: 11:41 pm, Dec 19 2010
Posts: 4


Can u make just 1 file php ?

and i dont know man...

how to make this is bot...

module from file php-bot ?

in folder module ?

   

Back to Module Requests