A
A
Anthony12212020-09-19 21:20:46
Python
Anthony1221, 2020-09-19 21:20:46

How to give a role to a user knowing only his ID?

I need to assign a role to a user using his ID, as I understand it, I need to get a member object anyway, but I still can’t figure out how to do this with a user ID.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
UberPool, 2020-09-20
@Anthony1221

You get the server member by its id.
And you give out a role.
Try like this

member = discord.utils.get(ctx.author.guild.members, id=ид пользователя)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question