Top-gg-Community / dotnet-sdk

MIT License
32 stars 11 forks source link

How do I actually use the shard counting? #14

Open th0mk opened 4 years ago

th0mk commented 4 years ago

I was trying to implement the shard counting today, but it seems a bit complicated. I know that indexShard is the shard you are posting from, shardCount is how many shards, and shards is a array of numbers that says how many servers are on each shard. Except I don't have a specific shard that I'm posting from, and this doesn't sound the same as the docs.

Is it maybe an idea to add examples for people that use Discord.NET on how to use this (with DiscordShardedClient)? Because I also searched github and I didn't find anyone that actually implemented this successfully.

velddev commented 4 years ago

Hey. Sorry for the late reply

await me.UpdateStatsAsync(24, 50, new[] { 12, 421, 62, 241, 524, 534 });

In this example it shows from left to right

this would mean that shard 24 has 12 guilds, shard 25 has 421 and so on. Only up to shard 29 is being updated in this example. As you might run an x amount of shards per system.

AbnerSquared commented 4 years ago

I'm currently adding and re-polishing the documentation for the library, if any of you would like to add feedback.

I'm also planning on adding some of the other missing properties that widgets have, such as its image format (SVG or PNG), as well as the useavatar query, which is a boolean (Likewise, I was planning on replacing the color definitions to use System.Drawing.Color instead, but depending on how others view it, this might make others upset since it now requires another dependency they might not want to use, so I can leave those as extensions).

I was also renaming some of the classes, methods, and properties to just be a bit more direct, such as DiscordBotListApi to BaseDblClient, and AuthDiscordBotListApi to DblClient, since normally it would require a token (although since these definitely warrant breaking changes, I can revert them for now).

I'm also planning to add some of the advanced search queries that the API has, such as checking if a specific field is equal to a certain value, as well as defining what to sort bots by.

Here's the current branch that all of this is taking place in:

https://github.com/AbnerSquared/DiscordBotList.Net