Python 回复后如何删除用户输入命令
Python Bot在发送回复后未删除用户输入命令。我在最后一行添加了Python 回复后如何删除用户输入命令,python,python-3.x,discord,discord.py,Python,Python 3.x,Discord,Discord.py,Python Bot在发送回复后未删除用户输入命令。我在最后一行添加了wait bot.delete_message(message),回复后仍然没有删除 示例:在bot回复的Pong之后。它应该删除?ping @bot.command(pass_context=True) async def ping(ctx): msg = "Pong. {0.author.mention}".format(ctx.message) await bot.say(msg) await b
wait bot.delete_message(message)
,回复后仍然没有删除
示例:在bot回复的Pong
之后。它应该删除?ping
@bot.command(pass_context=True)
async def ping(ctx):
msg = "Pong. {0.author.mention}".format(ctx.message)
await bot.say(msg)
await bot.delete_message(message)
您没有变量名
消息
。而是删除调用上下文提供的消息
await bot.delete_message(ctx.message)