i DO NOT recommend you use this unless your bot is in a lot of channels all the time.
You need operserv exceptions.
Ex:
/invite botname #channel
[BG]botname has joined #channel
on *:invite:#:{
server -m $server 6667
set %ich $chan
nick [JOIN] $+ $me
timer 1 5 nick $me
}
on *:connect:{
if (%ich != $null) {
nick [ $+ $rand(A,Z) $+ $rand(A,Z) $+ ] $+ $me
join %ich
unset %ich
}
}