diff --git a/src/structures/chatting.dto.ts b/src/structures/chatting.dto.ts index f31f1995..792c8b6f 100644 --- a/src/structures/chatting.dto.ts +++ b/src/structures/chatting.dto.ts @@ -1,9 +1,4 @@ -import { - ApiExtraModels, - ApiHideProperty, - ApiProperty, - getSchemaPath, -} from '@nestjs/swagger'; +import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger'; import { IsFileType } from '@waha/nestjs/validation/IsFileType'; import { TrimString, TrimStrings } from '@waha/nestjs/validation/TrimString'; import { GetChatMessagesQuery } from '@waha/structures/chats.dto'; @@ -43,6 +38,7 @@ import { ChatIdProperty, ConvertApiProperty, GeneratedMessageIdProperty, + MentionsProperty, ReplyToProperty, } from './properties.dto'; @@ -190,7 +186,7 @@ export class MessageTextRequest extends ChatRequest { text: string = 'Hi there!'; - @ApiHideProperty() + @MentionsProperty() mentions?: string[]; @ReplyToProperty() @@ -272,7 +268,7 @@ export class MessageLinkCustomPreviewRequest extends ChatRequest { export class EditMessageRequest { text: string = 'Hello, world!'; - @ApiHideProperty() + @MentionsProperty() mentions?: string[]; linkPreview?: boolean = true; @@ -320,7 +316,7 @@ class FileRequest extends ChatRequest { export class MessageImageRequest extends FileRequest { caption?: string; - @ApiHideProperty() + @MentionsProperty() mentions?: string[]; @ReplyToProperty() @@ -330,7 +326,7 @@ export class MessageImageRequest extends FileRequest { export class MessageFileRequest extends FileRequest { caption?: string; - @ApiHideProperty() + @MentionsProperty() mentions?: string[]; @ReplyToProperty() @@ -366,7 +362,7 @@ export class MessageVideoRequest extends ChatRequest { caption?: string = 'Just watch at this!'; - @ApiHideProperty() + @MentionsProperty() mentions?: string[]; @ApiProperty({ diff --git a/src/structures/properties.dto.ts b/src/structures/properties.dto.ts index ae9ab07b..0c54f662 100644 --- a/src/structures/properties.dto.ts +++ b/src/structures/properties.dto.ts @@ -30,6 +30,15 @@ function ReplyToProperty() { }); } +function MentionsProperty() { + return ApiProperty({ + description: + 'Chat IDs to mention in the message. Use ["all"] to mention all participants in a group.', + example: ['11111111111@c.us'], + required: false, + }); +} + function GeneratedMessageIdProperty() { return ApiProperty({ description: 'Pre-generated message id', @@ -50,6 +59,7 @@ export function ConvertApiProperty() { export { ChatIdProperty, GeneratedMessageIdProperty, + MentionsProperty, MessageIdOnlyProperty, MessageIdProperty, ReplyToProperty,