jaraco / irc

Full-featured Python IRC library for Python.
MIT License
390 stars 85 forks source link

Need handler for on_names #90

Closed BlinkyStitt closed 8 years ago

BlinkyStitt commented 8 years ago

There is a names method on the ServerConnection class and there is an on_endofnames event handler, but I don't see the actual names attached to that event and on_names doesn't seem to do anything.

This is the string representation of the endofnames event I can get.

type: endofnames, source: irc.example.net, target: testuser, arguments: [u'#testchannel', u'End of NAMES list'], tags: []

Whats the proper way to handle the response to names? Or is there some other way to get the list of users in a channel?

jaraco commented 8 years ago

It looks to me like irc.bot.SingleServerIRCBot defines a _on_namreply in which it stores the names of users in the channel, and then _on_join and _on_part for updating the list of users.

I'm less sure about the names command. I recommend using the SingleServerIRCBot unless you feel like getting dirty with the underlying implementation.

BlinkyStitt commented 8 years ago

Aha. I had searched for "name," but not "namreply."

I am using the SingleServerIRCBot, so this will work well. Thank you.