[英]How do I delete the ?Say command message after sending the response in this code?
我刚刚将?say
命令添加到我的代码中,我还希望机器人删除我发送的消息。
这是说命令:
@client.command(aliases = ['Say'])
async def say(ctx, *args):
response = ""
for arg in args:
response = response + " " + arg
await ctx.channel.send(response)
如果要删除为运行命令而发送的消息,可以使用await ctx.message.delete()
。
@client.command(aliases = ['Say'])
async def say(ctx, *args):
response = ""
for arg in args:
response = response + " " + arg
await ctx.channel.send(response)
await ctx.message.delete()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.