feat(listeners): support for chaining method listeners

This commit is contained in:
xTCry [Vladislav Kh]
2021-08-01 07:31:09 +03:00
parent 0339fe15ae
commit a4cb8df434
4 changed files with 41 additions and 28 deletions

View File

@@ -2,7 +2,7 @@ import { Injectable } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import {
SCENE_METADATA,
LISTENER_METADATA,
LISTENERS_METADATA,
UPDATE_METADATA,
} from '../telegraf.constants';
import { ListenerMetadata } from '../interfaces';
@@ -21,8 +21,8 @@ export class MetadataAccessorService {
return !!this.reflector.get(SCENE_METADATA, target);
}
getListenerMetadata(target: Function): ListenerMetadata | undefined {
return this.reflector.get(LISTENER_METADATA, target);
getListenerMetadata(target: Function): ListenerMetadata[] | undefined {
return this.reflector.get(LISTENERS_METADATA, target);
}
getSceneMetadata(target: Function): string | undefined {