cleaning twitter, bot

This commit is contained in:
Ryan Hitchman 2009-03-15 14:04:02 -06:00
parent a048452deb
commit 29e7fef87f
2 changed files with 7 additions and 6 deletions

10
bot.py
View File

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

View File

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