#๐ its giving me this error where position is incorrect or smt, i cant understand what its saying!
22 messages ยท Page 1 of 1 (latest)
@hazy hawk
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
the ctx.guild.create_role() function doesn't take a position arg
you can hoist the role in the create_role func with hoisted=True
but to set its position, you need to edit it by getting the role and calling .edit() on it
https://discordpy.readthedocs.io/en/stable/api.html#discord.Role.edit
i need further explanation on the position thing
await ctx.guild.create_role(...) returns a Role
you can then call edit on it
def your_command(ctx):
...
new_role = await ctx.guild.create_role(...)
await new_role.edit(position=...)
ohhhhhhhh
ctx.guild.create_role() doesn't accept position itself
never seen that
i am learning with chatgpt and it is extremely good at learning code but it is 2 years outdated ._.
and also how do i set default position, cuz i read 0 is the top so that doesn't work?
why wouldn't 0 be bottom?
@keen plover it says it cant take a hoisted arg
Try hoist instead of hoisted
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.