bind pubm - * reply:action
proc reply:action {nick host hand chan txt} {
set txt [string tolower $txt]
if {([string match -nocase "goes to sleep" $txt] || [string match -nocase "wants to sleep" $txt]) && ![isbotnick $nick]} {
puthelp "PRIVMSG $chan :$nick, don't fall asleep"
}
return 0
}
But, I want this command to be performed only when a user says: /me goes to sleep or /me wants to sleep (\001ACTION \001), and not a PRIVMSG. How can I change the string match so it works only with ACTION, and not PRIVMSG?
bind ctcp - ACTION reply:action
proc reply:action {nick uhost hand dest key text} {
if {[string match -nocase "*goes*sleep*" $text] || \
[string match -nocase "*want*sleep*" $text] && $dest eq "JaySon"} {
puthelp "PRIVMSG $dest :$nick, don't fall asleep"
}
}
I want it to make it only respond to one user, but even when other users besides "JaySon" say "*goes*sleep*" or "*want*sleep*", the bot still responds this message in the channel.
I want it to make it only respond to one user, but even when other users besides "JaySon" say "*goes*sleep*" or "*want*sleep*", the bot still responds this message in the channel.