我正在执行“禁止命令”,这里有一个明显的问题 真的很傻,所以我需要帮助。
@client.command()
@commands.has_permissions(kick_members=True)
@client.has_permissions(kick_members=True)
async def kick(ctx, user, *, reason):
try:
await user.ban(delete_messages_days=4)
except:
print('USER BAN ATTEMPT FAILED.')
ctx.send("I can't ban {}".format(user))
答案 0 :(得分:1)
在命令kick_members
和ban_members
上使用@commands.has_permissions
装饰器:
@bot.command()
@commands.has_permissions(kick_members=True, ban_members=True)
async def command(ctx):
pass