5

I'm trying to get channel's user list using {{self.say(channel, "WHO",100)}}. How can I get the response? Which method I should override?

miku
  • 181,842
  • 47
  • 306
  • 310
alessmar
  • 4,689
  • 7
  • 43
  • 52

1 Answers1

7

Here are some additional methods which should help you get further along. You handle a given reply RPL_NAME by defining a method irc_RPL_NAME. So for RPL_WHOREPLY you define irc_WHOREPLY:

    def who(self, channel):
        "List the users in 'channel', usage: client.who('#testroom')"
        self.sendLine('WHO %s' % channel)

    def irc_RPL_WHOREPLY(self, *nargs):
        "Receive WHO reply from server"
        print 'WHO:', nargs

    def irc_RPL_ENDOFWHO(self, *nargs):
        "Called when WHO output is complete"
        print 'WHO COMPLETE'

    def irc_unknown(self, prefix, command, params):
        "Print all unhandled replies, for debugging."
        print 'UNKNOWN:', prefix, command, params
samplebias
  • 37,113
  • 6
  • 107
  • 103
  • 2
    WHO isn't quite the right IRC command to use to get the list of users in a channel. It's sort of a server-wide name listing. NAMES is the command to use to list users in a channel. Even though the poster said he was using WHO, I think this answer would be better if it also showed how to interpret a NAMES response. Then it will really answer the question in the topic of the question. – Jean-Paul Calderone Jul 13 '11 at 13:41