import { SetMetadata } from '@nestjs/common'; import { UpdateMethodArgs, UpdateMethods } from '../telegraf.types'; import { UPDATE_LISTENER_METADATA } from '../telegraf.constants'; import { ListenerMetadata } from '../interfaces/listener-metadata.interface'; export function createUpdateDecorator( method: Method, ) { return (...args: UpdateMethodArgs): MethodDecorator => { return SetMetadata(UPDATE_LISTENER_METADATA, { method, args, } as ListenerMetadata); }; }