mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-12-15 09:49:54 +03:00
docs: support docs versioning, new update hook decorators docs added
This commit is contained in:
17
website/versioned_docs/version-1.3.0/bot-injection.md
Normal file
17
website/versioned_docs/version-1.3.0/bot-injection.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
id: bot-injection
|
||||
title: Bot injection
|
||||
sidebar_label: Bot injection
|
||||
slug: /bot-injection
|
||||
---
|
||||
|
||||
At times you may need to access the native `Telegraf` instance. For example, you may want to connect stage middleware. You can inject the Telegraf by using the `@InjectBot()` decorator as follows:
|
||||
```typescript
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectBot, TelegrafProvider } from 'nestjs-telegraf';
|
||||
|
||||
@Injectable()
|
||||
export class BotSettingsService {
|
||||
constructor(@InjectBot() private bot: TelegrafProvider) {}
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user