Action Methods Recall the code to private message a channel or user: ... The library contains more methods similar to the privmsg method, and a simple method is much easier to use than tinkering with the protocol itself. One such method is an extension of the privmsg method – privmsg_many. While privmsg handles a single target, privmsg_many can easily handle multiple targets. Here's how it works: ... When you connect to a network, Python-IRCLib will automatically provide the server with a nickname. However, you may wish to change the nickname assigned to your application based on events or the status of your application. This is done with the nick method, which takes a single string as an argument: ... It may be necessary for your application to acquire information about the network it is operating on. Several methods are availible that send out the proper signal. However, keep in mind that you will need to set up the proper handlers to catch the server's response. If you've read the previous article thorougly, then this shouldn't be too much of a challenge. Let's catch one event, though, just to refresh your memory. The who method sends out a “WHO” command like this: ... print ' '.join ( event.arguments() ) More specific information about a user can be obtained using the whois method. Again, it takes a single argument: ... Again, the server sends a response that must be caught. In the last article, I presented a list of all supported events. Go ahead and search through the list for the appropriate event codes, and create an application that catches the server's reply to the “WHOIS” command. The last of the “who” commands is the “WHOWAS” command. It is accessed like this: ...
blog comments powered by Disqus |