所以我用普通的婴儿车作为我的Discord机器人,当我最终开始得到这个信息:
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'
因为它是一个
coroutine
,所以把await
放在它前面试试这个:
await memes.hot(limit=100)
相关问题 更多 >
编程相关推荐