calico-crusade / WolfLive.Api

And API for connecting to and creating bots for wolf.live in C#
MIT License
6 stars 1 forks source link

Get Groupe Member #1

Closed KevinAnass closed 3 years ago

KevinAnass commented 3 years ago

How I can Get All The users inside the group

calico-crusade commented 3 years ago

Please update to v1.2.2 once it is available on Nuget. Once you have updated you can access all of the users on a particular group using the following code inside of a command:

var users = await this.Client.GetGroupUsers(Group.Id);

There is an example of this available here. If this does not work for you, please reopen the issue.

There was an issue with the existing API where it was using an old version of the packet logic. This has been remedied.

KevinAnass commented 3 years ago

thank you so much

calico-crusade commented 3 years ago

No problem!

KevinAnass commented 3 years ago

I am sorry but is throwing this exception Error while deserializing packet: 400 { "code": 400 }

calico-crusade commented 3 years ago

Code 400 normally means the packet was malformed, which indicates that the group ID that you're requesting isn't valid. Could you send me an example of the code you're using to call the GetGroupUsers function?

KevinAnass commented 3 years ago

var groupusers = (await client.GetGroupUsers(3687058));

calico-crusade commented 3 years ago

Is 3687058 a valid group? I am getting a 403 error when I attempt to request this group's users as I'm not in it.

KevinAnass commented 3 years ago

yes I got this group from the Groups function you can try any group you are in

calico-crusade commented 3 years ago

Ok, I believe I have figured out the issue. There are too many users in the request. The request for user profiles will probably need to be broken up into separate calls. I will work on implementing this.

KevinAnass commented 3 years ago

thank you so much I am waiting for you

calico-crusade commented 3 years ago

It should work now. Please update to v1.2.3 of the nuget package.

A thing to note; if you're requesting a group with more than 100 users, that call will take a while. To avoid a service timeout, throttle and potential account bar, I had to put a 1 second time out after every 4 requests of 25 users. Please open this issue again, if it is still not working.

KevinAnass commented 3 years ago

thank you so much it's working without exception

calico-crusade commented 3 years ago

Awesome! Feel free to open another issue if you run into anything else, or if you want to suggest features!

KevinAnass commented 3 years ago

thank you