#how to get every members from a role
1 messages · Page 1 of 1 (latest)
Get all user and filter with Linq ig
You'd have to query for all members (Get/RequestGuildMembersAsync) and filter from there
Im trying to write a bot this the same goal, sorry if I dont understand what exactly you're talking about im semi new to coding, could you go into a little bit more detail if possible? I cant seem to find anything corresponding to that in the documentation
The library requires lower-intermediate level of familiarity with C#, as well as .NET TAP. If you're not sure where to start, check out these links:
C# tutorial series for absolute beginners: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/, https://channel9.msdn.com/Series/C-Fundamentals-for-Absolute-Beginners
Task-based Asynchronous Pattern (TAP): https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/task-based-asynchronous-pattern-tap
Bonus readings:
LINQ: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/ (it is recommended you use method syntax, as mentioned here https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/linq/query-syntax-and-method-syntax-in-linq - syntax method is far more powerful and flexible)
Good resources
However what I was saying is that if you call the GetAllMembers method on a DiscordGuild, you're given a list of all members from the server, which you can then use LINQ (if you're familiar with methods like .Where, .First, etc) to filter for whatever you're looking for
thank you a lot ^^ I'll try to see if I can get things running