【发布时间】:2021-07-25 21:49:05
【问题描述】:
我的 Bot 有一个命令可以清除一些单词或所有内容...
这是我的代码:
@bot.command(aliases=['c'])
@commands.has_permissions(manage_messages=True)
async def clear(ctx, amount: int = None):
if amount == 0:
await ctx.channel.purge(limit=10000000000000000000000)
await ctx.send("Cleared the entire chat!")
print("Cleared the chat!")
else:
await ctx.channel.purge(limit=amount)
await ctx.send("Done!")
print(f"Cleared {amount} messages!")
但如果我只是写 >clear 它会清除所有内容...我怎么能说它什么都不会清除或在 >clear 处说“输入金额”? 感谢您的帮助
【问题讨论】:
标签: python list discord bots embed