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:
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
