Browse Source

Add DI video link

pull/988/head
Hsu Still 7 years ago
parent
commit
179cd43a7f
No known key found for this signature in database GPG Key ID: 8601A145FDA95209
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      docs/faq/Commands.md

+ 2
- 1
docs/faq/Commands.md View File

@@ -51,7 +51,7 @@ Service is often used to hold data externally, so that they will
persist throughout execution. Think of it like a chest that holds persist throughout execution. Think of it like a chest that holds
whatever you throw at it that won't be affected by anything unless whatever you throw at it that won't be affected by anything unless
you want it to. Note that you should also learn Microsoft's you want it to. Note that you should also learn Microsoft's
implementation of [Dependency Injection] before proceeding, as well
implementation of [Dependency Injection] ([video]) before proceeding, as well
as how it works in [Discord.NET](../guides/commands/commands.md#usage-in-modules). as how it works in [Discord.NET](../guides/commands/commands.md#usage-in-modules).


A brief example of service and dependency injection can be seen below. A brief example of service and dependency injection can be seen below.
@@ -59,6 +59,7 @@ A brief example of service and dependency injection can be seen below.
[!code-csharp[DI](samples/commands/DI.cs)] [!code-csharp[DI](samples/commands/DI.cs)]


[Dependency Injection]: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection [Dependency Injection]: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection
[video]: https://www.youtube.com/watch?v=QtDTfn8YxXg


## I have a long-running Task in my command, and Discord.NET keeps saying that a `MessageReceived` handler is blocking the gateway. What gives? ## I have a long-running Task in my command, and Discord.NET keeps saying that a `MessageReceived` handler is blocking the gateway. What gives?




Loading…
Cancel
Save