【发布时间】:2021-06-27 08:54:29
【问题描述】:
我正在寻找编写一个shutdown-room 命令,将特定房间中的所有用户静音。 所以,我必须得到写消息的用户和消息内容。
现在我有这个,但在这种情况下,每条消息都会被监控:
def shut_check(msg):
return msg.content
@client.command()
@commands.has_permissions(manage_messages=True)
async def shut_room(ctx):
await ctx.send("Please send me the id of the room that you want to shut down.")
content = await client.wait_for("message", check=check)
现在,我有发送消息的内容,但我如何验证消息的作者是否为 ctx.author?强>
我有另一个请求,你能向我解释一下pass_context=True in 的目的是什么:
@client.command(pass_context=True)
【问题讨论】:
标签: python async-await discord discord.py bots