R
R
Raidene2021-11-27 23:46:45
Python
Raidene, 2021-11-27 23:46:45

Discord.py hierarchy how to do?

I don't know how to make hierarchy in bot.
For example, so that the bot does not mute the creator of the server
if the administrator has registered the command.
Or not kicked and the like.
Please please help.

As in juniper (But there is already js)

Answer the question

In order to leave comments, you need to log in

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

You write a list of roles from most authoritative to least authoritative.
When executing a kick/mute command, you compare the most authoritative role of the sender with the most authoritative role of the target. Authority here is measured as an index in the list of roles - the lower the better.
Well, then, you execute the command only if the sender is more authoritative than the target.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question