Gemster wrote:
...
for example if a user types .help in the channel #help the bot will respond but if they type .help in another channel like #lobby it wont respond.
Since FOO is not equal with foo you have to either use 'string tolower' on $chan where all upper (or title) case letters are converted to lower case OR 'string equal -nocase' where the strings are compared in a case-insensitive manner.
if {$chan != "#help"} {putquick "privmsg $chan :!help dont work in here;return}
//return, with a chan msg explaining why
if {$chan != "#help"} {return}
//return, without a channel msg
setudef flag whatever
bind pub - "!command" someproc
proc someproc {nick uhost handle chan text} {
if {([lsearch -exact [channel info $chan] {+whatever}] != -1)} {
# your procedure code
# line by line
# goes here
}
}
Use:
.chanset #channel +whatever
to enable, on a given channel
and
.chanset #channel -whatever
to disable it on a given channel.
Gemster,
Case-matching with channel names is generally an issue, as on most networks, clients are free to use whatever case they prefer. Also, most irc clients preserve the case the user used to join the channel:
Thus, someone joining #help and then typing .help, would then trigger the code, while someone joining #Help (same channel, different case) and then typing .help, would not. That is why you should use the code suggested by Caesar