How to use Twisted to list IRC channel users

I am trying to get a list of channel users using {{self.say(channel, "WHO",100)}} . How can I get an answer? Which method should I override?

+5
source share
1 answer

Here are some additional methods to help you move forward. You process this response RPL_NAME by defining the irc_RPL_NAME method. 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 
+7
source

Source: https://habr.com/ru/post/892616/


All Articles