When we scrape, we update discord users online status:
|
#finally discord |
|
#first we set everyone to offline |
|
DiscordUser.objects.all().update(status='offline') |
|
discord_users = requests.get('https://discordapp.com/api/guilds/287487891003932672/widget.json').json()['members'] |
|
for user in discord_users: |
|
discord_user = DiscordUser.objects.filter(uid=user['id']).first() |
|
if discord_user is not None: |
|
discord_user.status = user['status'] |
|
discord_user.save() |
Then we display it like that:

I just realised that this url only show first 100 users: https://discordapp.com/api/guilds/287487891003932672/widget.json
We should find another way to check who is online.
When we scrape, we update discord users online status:
openstudyroom/league/views.py
Lines 88 to 96 in d1979e1
Then we display it like that:

I just realised that this url only show first 100 users: https://discordapp.com/api/guilds/287487891003932672/widget.json
We should find another way to check who is online.