twitools/bottools/streaming.py
2017-04-01 20:28:50 +02:00

16 lines
434 B
Python

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