我想在discord.py 中创建一个新角色。
但我希望这个角色位于(比方说)角色中的第三位。
我怎样才能实现这个目标?
你会使用Role.edit,通过一个position
值,该值必须低于您的最高角色的职位。
@bot.command()
async def moverole(ctx, role: discord.Role, pos: int):
try:
await role.edit(position=pos)
await ctx.send("Role moved.")
except discord.Forbidden:
await ctx.send("You do not have permission to do that")
except discord.HTTPException:
await ctx.send("Failed to move role")
except discord.InvalidArgument:
await ctx.send("Invalid argument")
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)