Menu

Join function

Help
2003-08-11
2003-08-12
  • Nobody/Anonymous

    was trying to use the join fucntion but have been unable to get the example showing this to even work.

    The web server is apache 2, running php 4.3,  all other fucntions appears to work fine, can someone point me in the right direction?

     
    • Anonymous

      Anonymous - 2003-08-11

      it is in irccommands.php

      function join($channelarray, $key = null, $priority = SMARTIRC_MEDIUM)
          {
              if (!is_array($channelarray)) {
                  $channelarray = array($channelarray);
              }
             
              $channellist = implode(',', $channelarray);
             
              if ($key !== null) {
                  $this->_send('JOIN '.$channellist.' '.$key, $priority);
              } else {
                  $this->_send('JOIN '.$channellist, $priority);
              }
          }

       
    • Anonymous

      Anonymous - 2003-08-11

      oh and there is an example in all the example.php files:

      $irc->join(array('#channel_a','#channel_b'));

       
    • Nobody/Anonymous

      Sorry I did not state myselg clear, I want to have my bot greed new user as they join the channel.  I have been unble to get that to work.  Sorry for the misunderstanding.

       
    • Nobody/Anonymous

      In your action handlers section have:

      $irc->registerActionhandler(SMARTIRC_TYPE_JOIN,".*",$botname,"onjoin");

      This will perform the onjoin function of the $botname object whenever someone joins the channel.  An example for an auto greeting would be:

      function onjoin(&$irc,&$data) {
          if ($data->nick != $irc->_nick) {
                               $irc->message(SMARTIRC_TYPE_CHANNEL,$data->channel,"Welcome ".$data->nick." To ".$data->channel);
          }
      }

      Hopefuly that works :)  If not it's cause i made a typo....

      Peter

       

Log in to post a comment.