Answer the question
In order to leave comments, you need to log in
How to clear the role of all participants?
Hello , can anyone help write a command to allow !clrole @role mention, and have it cleared for all members.
In general, as I understand it, the point is that you need to remove it through the iterator, but you also need to check whether this person has this role.
In short, I did not succeed, help someone who can
Answer the question
In order to leave comments, you need to log in
@bot.command()
@commands.has_permissions(ban_members=True)
async def swipe(ctx):
role_name = ("Тостер")
role = tuple(get(ctx.guild.roles, name=n) for n in role_names)
for m in ctx.guild.members:
try:
await member.remove_roles(*role)
except:
print(f"Не удалось удалить роль для {m} либо её у него нет.")
await ctx.send("Удалено.")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question