import bottools.methods, dbtools, html, tweepy class BotStreamListener(tweepy.StreamListener): def __init__(self, bot, cid, *args, **kwargs): tweepy.StreamListener.__init__(self, *args, **kwargs) self.bot = bot self.cid = cid def on_status(self, status): bottools.methods.tweetMessage(status, self.cid, self.bot) def on_error(self, status): if status == 420: return False