Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-05-2002, 06:58 PM   #1 (permalink)
sarah31
Code Monkey
 
sarah31's Avatar
 
Join Date: May 2002
Location: canada
Posts: 55
sarah31 is on a distinguished road
python module for a bot app

Here is kind of a dumb question. I have a bot on my irc channle that i wrote a module for. I can get it loaded but the bot fails to execute the desired action.

the desired action is for one to type:
Code:
~troutslap <nick>
and the bot to respond:
Code:
***bot troutslaps <nick>
The bot is moobot 0.5 and is available from source forge. Below is the troutslap.py module:
Code:
"""troutslap.py-it's just stupid"""
from moobot_module import MooBotModule

class troutslap(MooBotModule):
        def __init__(self):
                self.regex = "^troutslap .+"

        def handler(self, **args):
                """it's just stupid"""
                import string
                who = string.join(args["text"].split(" ")[2:])
                text = "troutslaps " + who
                from irclib import Event
                target = args["channel"]
                if args["type"] == "privmsg":
                        from irclib import nm_to_n
                target=nm_to_n(args["source"])
                result = Event("action", "", target, [ text ])
                return result
any help would be most welcome, myself and the channel users eagerly await troutslap
sarah31 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
New Tutorial: Python Lists Overview sde Code Newbie News 3 03-24-2004 09:54 AM
PyCon 2004 - Python Developers Conference sde Code Newbie News 0 02-12-2004 03:45 PM
c++.net console app ? sde Standard C, C++ 5 03-13-2003 06:07 AM


All times are GMT -8. The time now is 12:10 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting