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

Inconsistent naming and values for setStats and getGuildCount #7

Open
Andre601 opened this issue Apr 5, 2019 · 0 comments
Open

Inconsistent naming and values for setStats and getGuildCount #7

Andre601 opened this issue Apr 5, 2019 · 0 comments

Comments

@Andre601
Copy link

Andre601 commented Apr 5, 2019

The problem

When I checked the code, I noticed, that setStats requires you to provide the Server count as an Integer.
On the other hand, does getServerCount() return the current Server count on the DBL-Site as a Long.

This makes it unnecessary complicated for the dev to update (or get) his bots Server count on DBL, since it requires them to use two different values: Integer for setStats and Long for getServerCount.
Java-APIs/Wrappers like JDA return the bots Server count as a Long, so you have to first change it to an Integer in order to send it through the setStats method.
While this isn't that complicated, it still is annoying and a useless step to do.

Also, the naming of the methods can be misleading.
Right now does setStats only update the total Server count of the bot, the Server count of a single shard from the bot or the Server count of all the shards the bot has.
Since this is literally the only thing the method does (And I'm fairly sure there won't be any future additions for stats to update) I recommend to rename those to setServerCount, to have a more consistent naming with the getServerCount method.

Links

Here are the mentioned methods that I mean.

setStats in DiscordBotListAPI.java:
https://github.com/DiscordBotList/DBL-Java-Library/blob/219345b9a8704fca8f9c46539ed98979ea53c2cb/src/main/java/org/discordbots/api/client/DiscordBotListAPI.java#L12-L14

getServerCount in Bot.java:
https://github.com/DiscordBotList/DBL-Java-Library/blob/219345b9a8704fca8f9c46539ed98979ea53c2cb/src/main/java/org/discordbots/api/client/entity/Bot.java#L120-L122

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

1 participant