mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-12-16 02:09:53 +03:00
docs: support docs versioning, new update hook decorators docs added
This commit is contained in:
30
website/versioned_docs/version-1.3.0/installation.md
Normal file
30
website/versioned_docs/version-1.3.0/installation.md
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
id: installation
|
||||
title: Installation
|
||||
sidebar_label: Installation
|
||||
slug: /
|
||||
---
|
||||
|
||||
```bash
|
||||
$ npm i nestjs-telegraf
|
||||
```
|
||||
|
||||
Once the installation process is complete, we can import the TelegrafModule into the root AppModule.
|
||||
|
||||
```typescript
|
||||
/* app.module.ts */
|
||||
|
||||
import { Module } from '@nestjs/common';
|
||||
import { TelegrafModule } from 'nestjs-telegraf';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TelegrafModule.forRoot({
|
||||
token: 'TELEGRAM_BOT_TOKEN',
|
||||
})
|
||||
],
|
||||
})
|
||||
export class AppModule {}
|
||||
```
|
||||
|
||||
The `forRoot()` method accepts the same configuration object as Telegraf class constructor from the Telegraf package, as described [here](https://telegraf.js.org/#/?id=constructor).
|
||||
Reference in New Issue
Block a user