I'm trying to do a discord bot that creates a category and sets permissions to roles and users, taking the users id as arguments:
for x in range(2, len(args)):
member= client.get_user(int(args[x]))
await message.guild.categories[-1].set_permissions(member, send_messages = True)
where args is the string array that contains the command, the name of the category, and the user IDs. the usage should be:
!create category-name 0000000 1111111
I have some problems with that, because is like the bot can't see the members of the server, and the only user he can add is me, the owner of the server if specified in the first argument (000000 in my example). If i put someone else's ID, the bot is not gonna add permissions for that user in the category. I figured out that maybe the bot can't see other users, in fact if i put the line:
print(message.guild.members)
it is gonna print only the bot as member,
prints this: [<Member id=762749337700007946 name='RoomBzot' discriminator='1334' bot=True nick=None guild=>]
I have no idea of the reason why it counts the members but can't see the other users, what can I do?
pip show Discord.py
in console to see) – Allister