I tried to get all user list of my guild (400members).
But,returned response has just 270 users.
This is sample of my source code.
How to get full user list of my guild ? Thany kou!
Discord.NET 2.0.1
.Net Frame Wordk 4.6.1
var client = new DiscordSocketClient();
var token = "secret"
await client.LoginAsync(TokenType.Bot, token);
await client.StartAsync();
//this returned users list has just 270 elements.
var users=client.Guilds.ToList()[0].Users.ToList();
Guild information isn't completed in its retrieval and processing until the Ready event is fired. Put all your logic in an event handler for that.
SocketGuild.Users returns a list of cached users. You need to download the users to get the full user set.
In addition, you should likely not be using ToList, as the data returned is in a format which can be used the same anyway.
I could get all user finally !
Thank you, everone for kind advice.
I'll keep studying, and work hard.