Title: How to do Dependency Injection with the new DSharpPlus.Commands framework? · DSharpPlus/DSharpPlus · Discussion #2017 · GitHub
Open Graph Title: How to do Dependency Injection with the new DSharpPlus.Commands framework? · DSharpPlus/DSharpPlus · Discussion #2017
X Title: How to do Dependency Injection with the new DSharpPlus.Commands framework? · DSharpPlus/DSharpPlus · Discussion #2017
Description: How to do Dependency Injection with the new DSharpPlus.Commands framework?
Open Graph Description: Is it possible? If so can you point me to an example?
X Description: Is it possible? If so can you point me to an example?
Opengraph URL: https://github.com/DSharpPlus/DSharpPlus/discussions/2017
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"How to do Dependency Injection with the new DSharpPlus.Commands framework?","text":"Is it possible? If so can you point me to an example?
","upvoteCount":1,"answerCount":2,"acceptedAnswer":{"@type":"Answer","text":"I don't have a specific example on hand as I'm on mobile but yes, it is possible and is no different than normal dependency injection; services are resolved from the IServiceCollection passed to the DiscordClientBuilder, or if going the more integrated route, from the service collection you call .AddDiscordClient to.
\nDocumentation about the builder is available here
","upvoteCount":1,"url":"https://github.com/DSharpPlus/DSharpPlus/discussions/2017#discussioncomment-10080753"}}}
| route-pattern | /_view_fragments/Voltron::DiscussionsFragmentsController/show/:user_id/:repository/:discussion_number/discussion_layout(.:format) |
| route-controller | voltron_discussions_fragments |
| route-action | discussion_layout |
| fetch-nonce | v2:9d7f62dd-2b72-9c84-8e42-3cd10cace8a1 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | CAF6:3F004:194C470:20B5DD3:6990926E |
| html-safe-nonce | f20c76eb0d15cb868a24ff95d73aa9c108c1bcf9cb6158b6b168ddadb797ead5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQUY2OjNGMDA0OjE5NEM0NzA6MjBCNUREMzo2OTkwOTI2RSIsInZpc2l0b3JfaWQiOiI2MTg2MTczMjk2NjQ1NTQyNTExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7d01840ca908847c55ec5a09840f7351a6bdd863e2401cbdcaaa91d3927d3d88 |
| hovercard-subject-tag | discussion:6947719 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/Voltron::DiscussionsFragmentsController/show/DSharpPlus/DSharpPlus/2017/discussion_layout |
| twitter:image | https://opengraph.githubassets.com/c1b54a08ad89c752afb8509765669a92f436df6b69c0c667073722cd14ee4823/DSharpPlus/DSharpPlus/discussions/2017 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1b54a08ad89c752afb8509765669a92f436df6b69c0c667073722cd14ee4823/DSharpPlus/DSharpPlus/discussions/2017 |
| og:image:alt | Is it possible? If so can you point me to an example? |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/DSharpPlus/DSharpPlus git https://github.com/DSharpPlus/DSharpPlus.git |
| octolytics-dimension-user_id | 36208721 |
| octolytics-dimension-user_login | DSharpPlus |
| octolytics-dimension-repository_id | 67243489 |
| octolytics-dimension-repository_nwo | DSharpPlus/DSharpPlus |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 67243489 |
| octolytics-dimension-repository_network_root_nwo | DSharpPlus/DSharpPlus |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width