我无法理解如何在discord.py中使用此代码

我无法理解如何在discord.py中使用此代码,discord,discord.py,Discord,Discord.py,它涉及用户输入,所以就像我被委托做一个提示,但我从来没有这样做过,所以这是我在网上发现的 playerChoice = await bot.wait_for('message', check=check(ctx.author), timeout=30) 我得到了一些,但我没有得到“消息”部分和“检查=检查” 这是我的全部代码 @client.command() 异步def事件(ctx): 等待ctx.send(“提示将在DMs中继续”) 嵌入=discord.embed(title=“事件提

它涉及用户输入,所以就像我被委托做一个提示,但我从来没有这样做过,所以这是我在网上发现的

playerChoice = await bot.wait_for('message', check=check(ctx.author), timeout=30)
我得到了一些,但我没有得到“消息”部分和“检查=检查”

这是我的全部代码


@client.command()
异步def事件(ctx):
等待ctx.send(“提示将在DMs中继续”)
嵌入=discord.embed(title=“事件提示”,description=“请指定事件类型。”)
embed.set#footer(“提示将在##秒后过期”)
等待ctx.author.send(嵌入=嵌入)
eventType=wait bot.wait_for('message',check=check(ctx.author),timeout=30)#我希望它发送事件类型。
等待ctx.send(事件类型)
我想要一个解释和一个可能的方法来改善这一点,并使其工作。提前感谢

消息
指事件。您也可以为事件
反应\u添加
语音\u状态\u更新
等执行此操作。
这意味着你在等待消息。
检查
准确定义您正在等待的内容。它是一个方法,返回
True
False

在我的情况下,我正在等待一个
消息
事件,该事件发布在同一
频道
,消息内容为
“hello”


如果您没有这样的检查,它将拾取一条可能由不同作者、不同渠道、不同公会发送的
消息。

如果我想在命令中转换,我该如何做?我可以用ctx替换消息吗?
@client.event
async def on_message(message):
    if message.content.startswith('$greet'):
        channel = message.channel
        await channel.send('Say hello!')

        def check(m):
            return m.content == 'hello' and m.channel == channel

        msg = await client.wait_for('message', check=check)
        await channel.send('Hello {.author}!'.format(msg))
await client.wait_for('message', check=check)