事件等待指定的消息



我试图在一个命令中创建一个事件,该命令将等待指定的用户,但它不起作用:

await bot.wait_for('message', check=check("282859044593598464"))
if message.author.id == "282859044593598464":

我想指定消息包含的内容。

使用

def check(message):
return message.author.id == 282859044593598464
await bot.wait_for('message', check=check)

然后,如果你想进行更多的检查,只需更改函数中的代码,并使其返回True(如果它是你想要的(例如特定内容((,如果不是,则返回False。例如:

def check(message):
return message.author.id == 282859044593598464 and message.content=="Here your text"

最新更新