Click here to Skip to main content
15,615,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
so yes. someone know how to get first possible role which works as muted?

not named 'muted'. im talking about permissions (aka - not see channels, no permissions given)

does discord block requests for permissions only and I NEED TO filter roles by its name?

What I have tried:

```
@bot.command()
@commands.has_permissions(administrator=True)
async def kill(ctx, arg1, member: discord.Member, *, reason=None):
if arg1 == "-15":
await member.ban(reason=reason)
elif arg1 == "-3":
await member.kick(reason=reason)

# from here important

elif arg1 == "-1":
role = discord.utils.get(ctx.guild.roles, permissions=None)
if role in ctx.guild.roles:
await member.add_roles(member, role)
else:
await ctx.send("there is no mute role yet. create one without permissions...")

# to here important

```
it throws in chat (error handling goes brrr) that role doesnt exist even if such was created (there are 2 empty roles in test servers. doesnt detect any of em). Terminal/console is empty, so command correct.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900