From EggWiki
Jump to navigation Jump to search

Sending and receiving /who information can be a non-trivial task in Tcl because of the large numbers of different messages sent related to the WHO request. Here is an example of how to tell Eggdrop that a WHO request is complete and it can now act on any updated information it received (in this case, it is assumed that Eggdrop previously sent a WHOX request asking for account information).

bind rawt - 315 endofwho

proc endofwho {from key text tags} {
  set chan [lindex [split $text] 0]
  foreach nick [chanlist $chan] {
    if {[getaccount $nick $chan] != "*"} {
      putlog "$nick on $chan is authenticated as [getaccount $nick $chan]"
    } else {
      putlog "$nick on $chan is not authenticated with services"
  # make sure there is no implicit return 1 which would stop further processing
  return 0