0

I want to create a top command that shows the first 10 Members that joined on the server. Unfortunately I found only one code for Javascript. But since I'm programming my Discordbot with Python, I need help.

Bαmbus
  • 61
  • 1
  • 1
  • 10
  • 1
    If your use-case is small you can achieve this by iterating through `Guild.members` and picking the users (10) who have the oldest join dates (datetime) `member.joined_at`. To make things easier you can sort `Guild.members` based on join date first and then take the last 10 elements. – InsertCheesyLine Nov 20 '20 at 14:53
  • Did my solution answer your question? https://stackoverflow.com/a/64931661/13228935 - if so, please mark it as accepted to close this one off. If not, please provide your code and addition info so that the community can better assist – LouieC Nov 24 '20 at 13:23

1 Answers1

0

If you're able to get all of the users into a list, sorted by their join date ascending, you can simply use list splicing; excellent answer here

your_list[:10]

This example will return index 0-9 inclusive of your_list

LouieC
  • 679
  • 8
  • 15