【发布时间】:2020-10-03 13:36:26
【问题描述】:
@bot.command()
@commands.has_role("Administrator")
async def mp(ctx, message):
await ctx.channel.purge(limit=1)
await ctx.send(message)`
你好,我不知道为什么,但它不接受所有参数,它只输入第一个单词而不是后面的那些
【问题讨论】:
@bot.command()
@commands.has_role("Administrator")
async def mp(ctx, message):
await ctx.channel.purge(limit=1)
await ctx.send(message)`
你好,我不知道为什么,但它不接受所有参数,它只输入第一个单词而不是后面的那些
【问题讨论】:
这就是commands 模块的工作方式,消息将被拆分为单词并分别提供给您的函数。根据the documentation,您可以在单词周围加上引号,让它们作为单个参数到达。
如果你想要完整的消息,你可以得到它ctx.message.content
【讨论】: