Skip to content

Use IHttpClientFactory if available in hosting packages#128

Draft
KubaZ2 wants to merge 3 commits intoalphafrom
feature/ms-extensions-http
Draft

Use IHttpClientFactory if available in hosting packages#128
KubaZ2 wants to merge 3 commits intoalphafrom
feature/ms-extensions-http

Conversation

@KubaZ2
Copy link
Copy Markdown
Member

@KubaZ2 KubaZ2 commented Jun 14, 2025

No description provided.

@github-actions
Copy link
Copy Markdown

The documentation preview is available at https://preview.netcord.dev/128.

@KubaZ2 KubaZ2 changed the title Use IHttpClientFactory is available in hosting packages Use IHttpClientFactory if available in hosting packages Jun 14, 2025
.ConfigureCommands(o => o.Prefix = ">")
.ConfigureApplicationCommands<ApplicationCommandInteraction, ApplicationCommandContext, AutocompleteInteractionContext>(o => o.DefaultParameterDescriptionFormat = "AA")
.ConfigureApplicationCommands(o => o.DefaultParameterDescriptionFormat = "XD")
.AddDiscordGateway(o => o.Intents = GatewayIntents.All)
Copy link
Copy Markdown

@AraHaan AraHaan Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If only .ConfigureDiscordGateway() could be merged into this call, and then have .AddDiscordGateway() internally call .AddHttpClient() for the user (and document it with the xml doc on the method).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ConfigureDiscordGateway call can be removed here. It is here for testing purposes.

Also the whole idea behind this feature is it not being default, as it would require a Microsoft.Extensions.Http dependency.

This feature has been dismissed for a long time because I don't really like the idea of searching the provider type by an assembly qualified type name. I also think this is too implicit. Well, I am just not a fan of this implementation I think.

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

Successfully merging this pull request may close these issues.

2 participants