From 29e7fef87fbb4ee840709af48375aa9032a24681 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Sun, 15 Mar 2009 14:04:02 -0600 Subject: [PATCH] cleaning twitter, bot --- bot.py | 10 +++++----- plugins/twitter.py | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index 3416233..e430c78 100755 --- a/bot.py +++ b/bot.py @@ -19,14 +19,14 @@ import yaml os.chdir(sys.path[0]) #do stuff relative to the installation directory class Bot(object): - def __init__(self): + def __init__(self, nick, channel, network): self.commands = [] # fn, name, func, args self.filters = [] #fn, name, func + self.nick = nick + self.channel = channel + self.network = network -bot = Bot() -bot.nick = nick -bot.channel = channel -bot.network = network +bot = Bot(nick, channel, network) print 'Loading plugins' typs = '|'.join('command filter event'.split()) diff --git a/plugins/twitter.py b/plugins/twitter.py index 63d8732..218e9af 100644 --- a/plugins/twitter.py +++ b/plugins/twitter.py @@ -20,4 +20,5 @@ def twitter(bot, input): return "can't find that username" tweet = tweet.find('status') - bot.say(': '.join(tweet.find(x).text for x in 'created_at user/name text'.split())) + bot.say(': '.join(tweet.find(x).text for x in + 'created_at user/screen_name text'.split()))