Python
  Home arrow Python arrow Page 4 - IRC on a Higher Level
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PYTHON

IRC on a Higher Level
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 9
    2005-10-05

    Table of Contents:
  • IRC on a Higher Level
  • Getting Started
  • Events
  • All Supported Events

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    IRC on a Higher Level - All Supported Events


    (Page 4 of 4 )

    Earlier, I promised a list of events that you can respond to. Here is a list of numeric codes and their appropriate codes:

    216 -> statskline
    217 -> statsqline
    214 -> statsnline
    215 -> statsiline
    212 -> statscommands
    213 -> statscline
    210 -> tracereconnect
    211 -> statslinkinfo
    218 -> statsyline
    219 -> endofstats
    491 -> nooperhost
    492 -> noservicehost
    407 -> toomanytargets
    406 -> wasnosuchnick
    346 -> invitelist
    347 -> endofinvitelist
    403 -> nosuchchannel
    341 -> inviting
    342 -> summoning
    348 -> exceptlist
    349 -> endofexceptlist
    409 -> noorigin
    263 -> tryagain
    262 -> endoftrace
    261 -> tracelog
    266 -> n_global
    265 -> n_local
    442 -> notonchannel
    423 -> noadmininfo
    422 -> nomotd
    424 -> fileerror
    414 -> wildtoplevel
    437 -> unavailresource
    411 -> norecipient
    412 -> notexttosend
    413 -> notoplevel
    371 -> info
    373 -> infostart
    372 -> motd
    375 -> motdstart
    374 -> endofinfo
    377 -> motd2
    376 -> endofmotd
    319 -> whoischannels
    318 -> endofwhois
    313 -> whoisoperator
    312 -> whoisserver
    311 -> whoisuser
    317 -> whoisidle
    316 -> whoischanop
    315 -> endofwho
    314 -> whowasuser
    393 -> users
    392 -> usersstart
    391 -> time
    395 -> nousers
    394 -> endofusers
    443 -> useronchannel
    368 -> endofbanlist
    369 -> endofwhowas
    366 -> endofnames
    367 -> banlist
    364 -> links
    365 -> endoflinks
    362 -> closing
    363 -> closeend
    361 -> killdone
    300 -> none
    301 -> away
    302 -> userhost
    303 -> ison
    305 -> unaway
    306 -> nowaway
    444 -> nologin
    244 -> statshline
    382 -> rehashing
    241 -> statslline
    445 -> summondisabled
    243 -> statsoline
    242 -> statsuptime
    381 -> youreoper
    436 -> nickcollision
    384 -> myportis
    432 -> erroneusnickname
    433 -> nicknameinuse
    431 -> nonicknamegiven
    451 -> notregistered
    331 -> notopic
    333 -> topicinfo
    332 -> topic
    258 -> adminloc2
    259 -> adminemail
    252 -> luserop
    253 -> luserunknown
    250 -> luserconns
    251 -> luserclient
    256 -> adminme
    257 -> adminloc1
    254 -> luserchannels
    255 -> luserme
    405 -> toomanychannels
    404 -> cannotsendtochan
    502 -> usersdontmatch
    402 -> nosuchserver
    401 -> nosuchnick
    465 -> yourebannedcreep
    464 -> passwdmismatch
    467 -> keyset
    466 -> youwillbebanned
    461 -> needmoreparams
    463 -> nopermforhost
    462 -> alreadyregistered
    221 -> umodeis
    446 -> usersdisabled
    501 -> umodeunknownflag
    234 -> servlist
    235 -> servlistend
    231 -> serviceinfo
    232 -> endofservices
    233 -> service
    441 -> usernotinchannel
    322 -> list
    323 -> listend
    321 -> liststart
    324 -> channelmodeis
    476 -> badchanmask
    329 -> channelcreate
    477 -> nochanmodes
    201 -> traceconnecting
    200 -> tracelink
    203 -> traceunknown
    202 -> tracehandshake
    205 -> traceuser
    204 -> traceoperator
    207 -> traceservice
    206 -> traceserver
    209 -> traceclass
    208 -> tracenewtype
    475 -> badchannelkey
    003 -> created
    002 -> yourhost
    001 -> welcome
    005 -> featurelist
    004 -> myinfo
    474 -> bannedfromchan
    485 -> uniqopprivsneeded
    484 -> restricted
    483 -> cantkillserver
    482 -> chanoprivsneeded
    481 -> noprivileges
    472 -> unknownmode
    473 -> inviteonlychan
    471 -> channelisfull
    353 -> namreply
    352 -> whoreply
    351 -> version
    421 -> unknowncommand
    478 -> banlistfull

    As you can see, it's quite a list. Specific information can be found in the IRC protocol's documentation, but you most likely won't want to respond to most of the events supported by Python-IRCLib. There is simply no need, unless your aim is to create a full IRC client.

    A few more events are also defined:

    dcc_connect
    dcc_disconnect
    dccmsg
    disconnect
    ctcp
    ctcpreply
    error
    join
    kick
    mode
    part
    ping
    privmsg
    privnotice
    pubmsg
    pubnotice
    quit

    The most recent events contain mostly events to which you will need to give some thought when building your application, such as private messages and notices.

    Conclusion

    In this article, we've taken a look at a very important concept in Python-IRCLib: catching and reacting to events. Any application of purpose that interacts through IRC will have to examine events, whether it simply saves statistics and logs of activity or does something a bit more complex, such as take commands from select users and behave appropriately.

    It is not possible to cover all of the library's features in just one article, so don't worry if you feel left in the dark right now. An understanding of events is important before we continue to more of the library's features, such as the building of bots.

    Experiment with event handling in Python-IRCLib. One helpful technique is to turn the DEBUG variable on and examine the incoming data. If anything pops up that you don't recognize, it might be worth taking a look at.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hello, all.I've always been interested in playing around with IRC, and Python...
       · I just finished writing a game-playing bot using irclib. Well, perhaps finished is...
       · As the topic says, how does one detect time outs and other disconnection errors?
     

       

    PYTHON ARTICLES

    - SSH with Twisted
    - Mobile Programming in Python using PyS60: UI...
    - Python: Count on It
    - Python Strings: Spinning Yarns
    - Python: More Fun with Strings
    - Python: Stringing You Along
    - Python Operators
    - Bluetooth Programming in Python: Network Pro...
    - Python Sets
    - Python Conditionals, Lists, Dictionaries, an...
    - Python: Input and Variables
    - Introduction to Python Programming
    - Mobile Programming in Python using PyS60: Ge...
    - Bluetooth Programming using Python
    - Finishing the PyMailGUI Client: User Help To...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway