mirror of
https://github.com/yawaflua/Telegram.Net.git
synced 2025-12-09 20:19:28 +02:00
Fix error with broken dependencies.
This commit is contained in:
16
README.md
16
README.md
@@ -20,6 +20,20 @@ Ensure you have the required dependencies installed:
|
||||
|
||||
## Usage
|
||||
|
||||
### Provide dependencies in class
|
||||
You can provide dependencies in class from constructor, and after it use it like `static`.
|
||||
```csharp
|
||||
public class Example : IUpdatePollingService
|
||||
{
|
||||
private static MyCoolService _service; // It should to be static!
|
||||
|
||||
public Example(MyCoolService service)
|
||||
{
|
||||
_service = service;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Inline Query Handling
|
||||
Use the `InlineAttribute` to register a method as an inline query handler.
|
||||
|
||||
@@ -87,4 +101,4 @@ public static async Task HandleUpdate(ITelegramBotClient bot, Update update, Can
|
||||
```
|
||||
|
||||
## License
|
||||
This project is open-source and available under the MIT License.
|
||||
This project is open-source and available under the [Apache 2.0 license](LICENSE)
|
||||
Reference in New Issue
Block a user