79128260

Date: 2024-10-26 10:07:45
Score: 0.5
Natty:
Report link

I found out why I got a code 403. I was, due to a faulty algorithm, trying to give users a bot's role (Machine_control):`async def get_game_roles(self,ctx: discord.ext.commands.Context): roles = list(ctx.guild.roles)

    for role in roles:
        print(role)
        if role.name not in ["1","2","3","4","5","6","7","8","9"]:
            roles.remove(role)
            #print(f"Removed role {role} from roles")

    print(f"Keeping roles :")
    for prnt_role in roles:
        print(prnt_role.name,end=", ")
    random.shuffle(roles)
    print("")
    return roles`

So it returned [1,2,3,4,5,6,7,8,9,Machine_Control].

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Stardaz