build DiscordClient on top of IOC#1908
Conversation
VelvetToroyashi
left a comment
There was a problem hiding this comment.
LGTM aside from comments; gonna open an issue wrt some tomfoolery happening regarding ratelimit handling
| this.httpClient.BaseAddress = new Uri(Utilities.GetApiBaseUri()); | ||
| this.httpClient.Timeout = timeout; |
There was a problem hiding this comment.
Perhaps it'd be worthwhile to go the Remora route and expose a [rest] client builder; there's occasional reason to change what the client does (e.g., adding additional polly handlers for metrics, or using the canary api for one reason or another)
There was a problem hiding this comment.
(Client builder as in Action<HttpClient> parameter)
There was a problem hiding this comment.
i think this is something we should look into in a separate pull request to customize specifically rest further
OoLunar
left a comment
There was a problem hiding this comment.
I think this is okay? Regardless please write a migration guide for this PR specifically. Before we release v5, we'll merge the migration guide for this PR and all other breaking changes into one. I just want a guide to reference right now since I myself don't particularly understand what the intended use is.
VelvetToroyashi
left a comment
There was a problem hiding this comment.
Cursory glance (namely because of a jumble of a diff), but LGTM.
|
@OoLunar added the migration guide as requested |
* centralize the service provider * prepare the rest client for IOC * obsolete all the old events... * obsolete SocketErrored even more * enables registering event handlers to the service collection * fix event-related build errors * make DiscordApiClient IOC-constructible * death (migrate events (not dispatch yet) to the interim model) * update DiscordClient.Dipshit.cs * fix most trivial build errors * more progress towards usability * DSharpPlus.dll should now work:tm: * build? * miser, miser * add public construction code * update docs * convenience * details * migration guide (partial, only as far as this PR is concerned) * build * switch to CreateDefault * nit
current status:
non-goals of this PR:
leave issues for any other features associated with this you may want
closes #1683
makes progress towards #1820