Jafer.balti
Jafer.balti

Reputation: 584

Restcord API listGuildMembers

Using restcord API when I call listGuildMembers it returns nothing. I am not sure about the third parameter

https://www.restcord.com/Guild/List%20Guild%20Members/

I called it by 3 different ways but same empty result

$users = $client->guild->listGuildMembers(['guild.id' => 451261315667853312, 'limit' => 25]);

$users = $client->guild->listGuildMembers(['guild.id' => 451261315667853312, 'limit' => 25, 'after'=>0]);

$users = $client->guild->listGuildMembers(['guild.id' => 451261315667853312, 'limit' => 25, 'after'=>450894467260743690]); //450894467260743690 this is guild_owner ID

I then downloaded the dev branch from restcode instead of live env. It solved my problem i.e it started giving me the list of members but it is returning NULL on the email index. Screenshot is also attached. Kindly help if anyone have already fixed the same issue.

enter image description here

Upvotes: 2

Views: 403

Answers (1)

Jafer.balti
Jafer.balti

Reputation: 584

Ok it turns out that Discord never returns email address of a user untill it is pre authenticated by the user. It was returning NUll because user of which I was trying to fetch email was never authenticated my script to fetch email.

Upvotes: 2

Related Questions