It is not possible to member.remove_roles(member.roles) without removing the @everyone role from member.roles first #5937
-
SummaryWanting to remove all roles from a member makes an extra unnecessary step Reproduction StepsTo remove all roles from a member: Expected ResultsAll roles that member had before, should be removed from him Actual Results`Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): However, I managed to avoid this by doing: How this might be able to be fixed: Checklist
System Information
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
In order to remove roles you should probably use |
Beta Was this translation helpful? Give feedback.
-
i figured it out already , doesnt work if the member is a server booster
(discord doesnt let you remove that role)
ned, 16. svi 2021. 19:52 NimVrod ***@***.***> je napisao:
… In order to remove roles you should probably use await
member.edit(roles=[]). remove_roles is a higher level function with
atomicity but if you're clearing roles you should use the former.
nice but how will i return the roles when the user is unmuted
kinda of a late answer but if you still somehow didn't mange to do it or
for someone else who is searching I did it like this::
roles1 = member.roles #save the member roles await member.edit(roles=[])
#remove all member roles await member.edit(roles=roles1) #bring back the
old roles
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#5937 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/APWMGTWSN7KTVGOY4SSMN2TTOAA4ZANCNFSM4STBWDJA>
.
|
Beta Was this translation helpful? Give feedback.
In order to remove roles you should probably use
await member.edit(roles=[])
.remove_roles
is a higher level function with atomicity but if you're clearing roles you should use the former.