#by wiebe @ QuakeNet
#requires showwho.tcl



#help who pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} help who" c_who:help:pub

proc c_who:help:pub { nick uhost handle chan text } {
  lappend output "Usage: who <nick>"
  lappend output "Shows /who info for the given nick, nick user host ip etc."
  if { [catch {set x [cnotice $nick $output]} error] || !$x } {
    foreach t $output { puthelp "NOTICE $nick :$t" }
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}



#who pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} who" c_who:pub
bind pubm fvlomn|fvlomn "% ${botnet-nick} who *" c_who:pub

proc c_who:pub { nick uhost handle chan text } {
  set text2 [join [lrange [split $text] 2 end]]
  if { [catch {showwho:pub $nick $uhost $handle $chan $text2} error] } {
    putlog "ERROR using showwho.tcl, perhaps you have not loaded it?"
    error $error
  }
  putloglev c $chan "[lindex [split $text] 1]: $nick $uhost $handle $chan [join [lrange [split $text] 2 end]]"
}

