feat: create inject all bots decorator

This commit is contained in:
atassis
2022-07-09 18:15:13 +08:00
parent 9935b87d45
commit 92ff5164a6
7 changed files with 46 additions and 5 deletions

View File

@@ -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';

View 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());