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()))