J
J
Ju12021-11-04 21:37:42
Bots
Ju1, 2021-11-04 21:37:42

Discord.py how to make it impossible to ban a person with a certain role?

I have a ban function in the bot, but I need to write some kind of condition under which it will be forbidden to ban this user, because he has some specific role. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vindicar, 2021-11-04
@Vindicar

In the ban command, check the user's roles through the roles property of the member object .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question