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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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);
}
}
oh and there is an example in all the example.php files:
$irc->join(array('#channel_a','#channel_b'));
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.
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