用Python编程Discord机器人-Aync Praw有问题

用Python编程Discord机器人-Aync Praw有问题,python,discord.py,Python,Discord.py,所以我用普通的婴儿车作为我的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/multip

所以我用普通的婴儿车作为我的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\u hot=memes.hot(limit=100)
,我得到了这个错误:

AttributeError: 'coroutine' object has no attribute 'hot'

因为它是一个
协同程序
,所以将
等待
放在它前面
试试这个:
wait memes.hot(limit=100)

memes是一个协同程序,在使用它的结果之前,你需要等待它。在你的代码中定义了
hot
?由于错误消息,您似乎没有定义它。请显示
memes
的定义。是的,很抱歉,我不该这么说:
memes=reddit.subreddit(“memes”)
这无法解决问题。如果
memes
是一个协同路由,那么memes.hot()将不存在。是的,我仍然得到
AttributeError:“协同路由”对象没有属性“hot”
:(好吧,因为memes是reddit.subreddit(“memes”),这应该是协同程序。尝试将
await
放在reddit.subredditOkay之前,现在它给了我这个-
SyntaxError:'await'外部函数