因此,当我最终开始收到以下消息时,我正在使用普通的Praw来处理我的不一致机器人:
It appears that you are using PRAW in an asynchronous environment.
It is strongly recommended to use Async PRAW: https://asyncpraw.readthedocs.io.
See https://praw.readthedocs.io/en/latest/getting_started/multiple_instances.html#discord-bots-and-asynchronous-environments for more info.它没有给我任何错误,但似乎很重要,所以我尝试切换到异步Praw。我将import praw更改为import asyncpraw,将reddit = praw.Reddit()更改为reddit = asyncpraw.Reddit()。
现在在我的代码中显示为memes_hot = memes.hot(limit = 100)的地方,我得到了这个错误:
AttributeError: 'coroutine' object has no attribute 'hot'发布于 2021-05-06 01:55:52
既然它是一个coroutine,就把await放在它前面。
试试这个:await memes.hot(limit=100)
https://stackoverflow.com/questions/67406171
复制相似问题