I'm using this code to get a list of people who reacted to the reaction
new_msg = await channel.fetch_message(id)
users = await new_msg.reactions[0].users().flatten()
users.pop(users.index(client.user))
if ctx.author in users:
users.pop(users.index(ctx.author))
but I want it to return id's of people who reacted to it so after that I could use a command like this
user = bot.get_user(userId)
await ctx.send(user.created_at)
and find out that how many user's account is older than n days
CodePudding user response:
ID is a field in the user object according to the discord-py Documentation.
So you can just do [user.id for user in users]
to get the list of IDs.
But since you want the user objects anyways, you can
for user in users:
await ctx.send(user.created_at)