diff --git a/src/decorators/params-validation.ts b/src/decorators/params-validation.ts index a165318..f817ac4 100644 --- a/src/decorators/params-validation.ts +++ b/src/decorators/params-validation.ts @@ -2,7 +2,7 @@ import { NewMessageEvent } from 'telegram/events/NewMessage.js'; import { DecoratorException } from '../exceptions.js'; import { commandParamsSchema } from '../keys.js'; -import { CommandParamsSchema, ExtendedMessage, ValidatedCommandParams } from '../types.js'; +import { CommandParamsSchema, MessageWithParams, ValidatedCommandParams } from '../types.js'; export function paramsValidation( target: (this: This, ...args: Args) => Return, @@ -69,7 +69,7 @@ export function paramsValidation( return; } - (event.message).params = validatedParams; + (event.message).params = validatedParams; } return await target.apply(this, args); diff --git a/src/types.ts b/src/types.ts index 623649f..cdfdbbb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -39,7 +39,7 @@ export type CommandParamsSchema = Dict; export type ValidatedCommandParams = Dict; -export type ExtendedMessage = Api.Message & { params?: ValidatedCommandParams }; +export type MessageWithParams = Api.Message & { params?: T }; export type ExtendedCommand = Command & Record> & Record;