【发布时间】:2020-02-03 04:19:12
【问题描述】:
所以,使用discord.py-rewrite,我知道我可以使用:
def check(message):
"""Checks the message author and channel."""
return message.author == ctx.author and message.channel == ctx.channel
await bot.wait_for("message", timeout=180, check=check)
检查消息输入(必须来自上下文作者和上下文通道)。但是因为我需要这个检查几个命令,我不能只做吗:
def check_msg(context, message):
return context.author == message.author and context.channel == message.channel
然后使用:
await bot.wait_for("message", timeout=180, check=check_msg)
【问题讨论】:
标签: python discord discord.py discord.py-rewrite