How can I get the highest role of a message.author?

37 Views Asked by At

i would like to get the name of a highest role in nextcord. Give it a variable for that? If you anything now about this, respond please.

What i have tried:

I have read the docs of nextcord, but i din't found it.

Thank you for you respondig

1

There are 1 best solutions below

0
esqew On BEST ANSWER

The description for Member.roles (equivalent to the Message.author's roles property) is pretty clear (emphasis mine):

A list of Role that the member belongs to. Note that the first element of this list is always the default ‘@everyone’ role.

These roles are sorted by their position in the role hierarchy."

Thus, this would make the "highest" role accessible like so:

message_object.author.roles[-1]