我得到的错误是:
RuntimeWarning: coroutine 'StdOutListener.on_status' was never awaited
if self.on_status(status) is False:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
我的stdOutListener看起来像这样:
class StdOutListener(StreamListener):
async def on_status(self, status):
channel = await bot.get_channel(64970710814)
await channel.send(status.text)
我了解我需要获取名为async'd的on_status,但是我该怎么做?我已尝试等待on_status中的大多数内容
相反,您可以使用is_async
参数在单独的线程中运行流。参见https://tweepy.readthedocs.io/en/latest/streaming_how_to.html#async-streaming。