jaraco / irc

Full-featured Python IRC library for Python.
MIT License
392 stars 87 forks source link

How to perform a whois query? #10

Closed jaraco closed 8 years ago

jaraco commented 8 years ago

How to perform a whois on a client?

For example:

When using singleserverircbot as the base class

on_pubmsg(self, c, e):
   user = nm_to_n(e.source())
   c.whois(user)

returns nothing


jaraco commented 8 years ago

When you call c.whois, a whois is a message sent to the server. It's an asynchronous operation for which the response may or may not come later. I've never used this feature before, but I suspect to catch the response, you need to define 'onwhois(self, c, e)' and parse out the message. If that doesn't work, then you'll have to dig into the IRC RFC and find out what message is sent in response to a whois query, and define 'on'.

Good luck, and please report back what you find.


Original comment by: Jason R. Coombs

jaraco commented 8 years ago

Its cool. You can close this.


Original comment by: unconscious

jaraco commented 8 years ago

Ill be sending you some pull requests with enhancements btw. :)


Original comment by: unconscious

jaraco commented 8 years ago

Not a bug, but a question. Glad to help, though.


Original comment by: Jason R. Coombs