I'm trying to make eggdrop send a msg to $nick when he requests a command for a channel where the bot is not on.
So, for an input /msg op #chan <nick> it would send a response "I'm not in #channel" (in the console there is already a message Tcl error [giveop]: illegal channel: #channelname).
This is a sample part of the script
Code: Select all
bind msg o|o op giveop
proc giveop {nick uhost handle text} {
global botnick
set nickopped "[lindex [split $text] 1]"
set channel "[lindex [split $text] 0]"
if {![onchan $nickopped $channel]} {
putserv "NOTICE $nick :$nickopped is not on $channel"
return 1
}
putserv "MODE $channel +o $nickopped
}
I tried several things but none of them didn't work
Code: Select all
if {![botonchan $channel]} {putserv "NOTICE $nick: I'm not on $channel"}
Code: Select all
if {![onchan $botnick $channel]} {putserv "NOTICE $nick: I'm not on $channel"}
Code: Select all
if {![validchan $channel]} {putserv "NOTICE $nick: I'm not on $channel"}