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  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
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? 
Google.com  
PYTHON

IRC on a Higher Level
By: Peyton McCullough
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 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:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log 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


    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.



     
     
    >>> More Python Articles          >>> More By Peyton McCullough
     

       

    PYTHON ARTICLES

    - Tuples and Other Python Object Types
    - The Dictionary Python Object Type
    - String and List Python Object Types
    - Introducing Python Object Types
    - Mobile Programming using PyS60: Advanced UI ...
    - Nested Functions in Python
    - Python Parameters, Functions and Arguments
    - Python Statements and Functions
    - Statements and Iterators in Python
    - Sequences and Sets in Python
    - Python Expressions and Operators
    - Dictionaries, Variables and Statements in Py...
    - Data Types in Python
    - The Python Language
    - SSH with Twisted





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek