Home>

How to make a bot when using the team created a role, moved it so high as soon as it may (that is, the bot number number, counting from below -1) and issued the author to the author?

  • Answer # 1

    This method of issuing the role is not safe, but your business. Although it depends on the privileges of the bot.

    @ Bot.comMand ()
    ASYNC DEF Add_role (CTX, ROLE_NAME):
        Role= await ctx.guild.create_role (name= role_name)
        Highest_role_Bot= Bot.user.roles [-1]
        await role.edit (Position= Highest_role_bot.position -1)
    
  • Answer # 2

    This method of issuing the role is not safe, but your business. Although it depends on the privileges of the bot.

    @ Bot.comMand ()
    ASYNC DEF Add_role (CTX, ROLE_NAME):
        Role= await ctx.guild.create_role (name= role_name)
        Highest_role_Bot= Bot.user.roles [-1]
        await role.edit (Position= Highest_role_bot.position -1)