Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

python - 如何从tweepy异步on_status?(How do I async on_status from tweepy?)

The error I'm getting is:

(我得到的错误是:)

RuntimeWarning: coroutine 'StdOutListener.on_status' was never awaited
if self.on_status(status) is False:
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

My stdOutListener looks like this:

(我的stdOutListener看起来像这样:)

class StdOutListener(StreamListener):

async def on_status(self, status):
    channel = await bot.get_channel(64970710814)
    await channel.send(status.text)

I understand that I need to get on_status called async'd, but how do I do this?

(我了解我需要获取名为async'd的on_status,但是我该怎么做?)

I've tried awaiting most of the things inside on_status

(我已经尝试过等待on_status内部的大多数事情)

  ask by sykezlol translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...