Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I actually use the shard counting? #14

Open
th0mk opened this issue Feb 17, 2020 · 2 comments
Open

How do I actually use the shard counting? #14

th0mk opened this issue Feb 17, 2020 · 2 comments

Comments

@th0mk
Copy link
Contributor

th0mk commented Feb 17, 2020

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
Copy link
Contributor

velddev commented Mar 26, 2020

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

  • the current index of which index it starts on.
  • the total amount of shards your configuration runs.
  • a list of guild counts

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
Copy link
Contributor

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

AbnerSquared added a commit to AbnerSquared/DiscordBotList.Net that referenced this issue Aug 27, 2020
This is one of the final updates made for the rewrite of this API. All classes have been documented as needed, several namespaces, classes, methods, and properties have been renamed to be easier to reference, and missing API methods and properties were implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants