Changes between Version 16 and Version 17 of PyBc/PythonBots

Show
Ignore:
Timestamp:
01/09/10 21:22:23 (8 months ago)
Author:
jvporter (IP: 75.134.26.59)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PyBc/PythonBots

    v16 v17  
    167167== Creating an IRC Bot == 
    168168 
    169 The first thing any IRC bot needs to do is connect  
     169Before we get started, let's go over a brief summary of how IRC works for those who don't know. IRC ("internet relay chat") is a protocol designed to let groups of users chat in individual rooms ("channels") on one or more networks. Most networks have several servers to minimize the load, and the servers stay in constant communication to allow users from one server on a network to talk to users on other servers on that network. There are hundreds of IRC networks available on the internet, each with thousands of channels. The actual protocol is pretty simple, and we could probably implement an IRC bot in Python just using network sockets, but why reinvent the wheel? 
     170 
     171=== Getting Started === 
     172 
     173The first thing any IRC bot needs to do is connect to a server and (usually) join a channel. Using {{{python-irclib}}}, this is a simple matter. 
    170174 
    171175{{{ 
     
    200204 
    201205== Replying to Messages == 
     206 
     207In order to make our IRC bot useful, we need to make it respond to messages from other users. We're going to make our bot respond to messages in channels that begin with "!pig". When our bot sees a message like that, it will look at the text after the "!pig" and translate it into Pig Latin and send it back to the user. To eliminate confusion, we'll also figure out the username of the person who sent the command and prefix our reply with that name. 
    202208 
    203209{{{