-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Attempts to resolve #961 #962
Conversation
All async methods in the library should be suffixed with |
I think everything is ready to be reviewed now, I double checked after work to make sure. |
src/Discord.Net.Rest/ClientHelper.cs
Outdated
|
||
public static async Task<int> GetRecommendShardCountAsync(BaseDiscordClient client, RequestOptions options) | ||
{ | ||
var response = await client.ApiClient.GetBotGatewayAsync(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs ConfigureAwait
@@ -459,6 +471,8 @@ internal virtual void Dispose(bool disposing) | |||
endpoint = () => $"channels/{channelId}/messages?limit={limit}"; | |||
return await SendAsync<IReadOnlyCollection<Message>>("GET", endpoint, ids, options: options).ConfigureAwait(false); | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor nitpick but this whitespace seems unnecessary
@@ -277,6 +277,18 @@ internal virtual void Dispose(bool disposing) | |||
await SendAsync("GET", () => "auth/login", new BucketIds(), options: options).ConfigureAwait(false); | |||
} | |||
|
|||
//Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why were these moved to REST instead of being left with gateway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was told it was a better place for them because they themselves are REST requests and should be accessible from that client as well.
I this it should be this way too. As before mentioned, since I have my bot set up in a more advanced configuration, it would be nice to be able to just access the data from the rest client so I can pass it to the individual clients who will then be establishing docket client connections from there.
I with it being there it is more open and therefor more flexible, even though this appears to be an edge case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fair to me
* Move REST requests to appropiate class * Add call to ClientHelper and expose to public API * Expose shard count request in public api * Expose method from interface * Update sharded client to utilize the new method * Method is already implemented in a base class * Refactor name to fit pattern for methods returning a `Task` * Adds missing ConfigureAwait * Corrects unnecessary whitespace * Removes unneeded whitespace
fixes #961