mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-09-30 04:18:51 +03:00
feat: create inject all bots decorator
This commit is contained in:
@@ -2,3 +2,4 @@ export * from './update.decorator';
|
||||
export * from './scene.decorator';
|
||||
export * from './wizard.decorator';
|
||||
export * from './inject-bot.decorator';
|
||||
export * from './inject-all-bots.decorator';
|
||||
|
9
lib/decorators/core/inject-all-bots.decorator.ts
Normal file
9
lib/decorators/core/inject-all-bots.decorator.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Inject } from '@nestjs/common';
|
||||
import { Telegraf } from 'telegraf';
|
||||
|
||||
import { getAllBotsToken } from '../../utils/get-all-bots-token.util';
|
||||
|
||||
export type AllBotsMap = Map<string, Telegraf<any>>;
|
||||
|
||||
export const InjectAllBots = (): ParameterDecorator =>
|
||||
Inject(getAllBotsToken());
|
Reference in New Issue
Block a user