Spaces:
Runtime error
Runtime error
| import { ApiProperty } from '@nestjs/swagger'; | |
| import { MessageDestination } from '@waha/structures/chatting.dto'; | |
| import { WAMessageBase } from '@waha/structures/responses.dto'; | |
| import { Type } from 'class-transformer'; | |
| import { | |
| IsBoolean, | |
| IsNotEmpty, | |
| IsNumber, | |
| IsOptional, | |
| IsString, | |
| ValidateNested, | |
| } from 'class-validator'; | |
| import { ChatIdProperty, ReplyToProperty } from './properties.dto'; | |
| export class EventLocation { | |
| ({ | |
| description: 'Name of the location', | |
| example: 'Luxe Nail Studio π ', | |
| }) | |
| () | |
| () | |
| name: string; | |
| // | |
| // Doesn't work right now | |
| // | |
| // @ApiProperty({ | |
| // description: 'Latitude of the location', | |
| // example: 38.8937255, | |
| // }) | |
| // @IsNumber() | |
| // @IsOptional() | |
| // degreesLatitude?: number; | |
| // | |
| // @ApiProperty({ | |
| // description: 'Longitude of the location', | |
| // example: -77.0969763, | |
| // }) | |
| // @IsNumber() | |
| // @IsOptional() | |
| // degreesLongitude?: number; | |
| } | |
| export class EventMessage { | |
| ({ | |
| description: 'Name of the event', | |
| example: "John's Nail Appointment π ", | |
| }) | |
| () | |
| () | |
| name: string; | |
| ({ | |
| description: 'Description of the event', | |
| example: | |
| "It's time for your nail care session! π\\n\\nYou'll be getting a *classic gel manicure* β clean, polished, and long-lasting. π\\n\\nπ *Location:* Luxe Nail Studio\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\n\\nFeel free to arrive *5β10 mins early* so we can get started on time π", | |
| required: false, | |
| }) | |
| () | |
| () | |
| description?: string; | |
| ({ | |
| description: 'Start time of the event (Unix timestamp in seconds)', | |
| example: 2063137000, | |
| }) | |
| () | |
| () | |
| startTime: number; | |
| ({ | |
| description: 'End time of the event (Unix timestamp in seconds)', | |
| example: null, | |
| required: false, | |
| }) | |
| () | |
| () | |
| endTime?: number; | |
| ({ | |
| description: 'Location of the event', | |
| required: false, | |
| type: EventLocation, | |
| }) | |
| () | |
| (() => EventLocation) | |
| () | |
| location?: EventLocation; | |
| ({ | |
| description: 'Whether extra guests are allowed', | |
| example: false, | |
| required: false, | |
| }) | |
| () | |
| () | |
| extraGuestsAllowed?: boolean; | |
| } | |
| export class EventMessageRequest { | |
| () | |
| chatId: string; | |
| event: EventMessage; | |
| () | |
| reply_to?: string; | |
| } | |
| export class EventCancelRequest { | |
| ({ | |
| description: 'ID of the event message to cancel', | |
| example: 'true_12345678901@c.us_ABCDEFGHIJKLMNOPQRST', | |
| }) | |
| () | |
| () | |
| id: string; | |
| } | |
| export enum EventResponseType { | |
| UNKNOWN = 'UNKNOWN', | |
| GOING = 'GOING', | |
| NOT_GOING = 'NOT_GOING', | |
| MAYBE = 'MAYBE', | |
| } | |
| export class EventResponse { | |
| response: EventResponseType; | |
| timestampMs: number; | |
| extraGuestCount: number; | |
| } | |
| export class EventResponsePayload extends WAMessageBase { | |
| eventCreationKey: MessageDestination; | |
| eventResponse?: EventResponse; | |
| /** Returns a message in a raw format */ | |
| ({ | |
| description: | |
| 'Message in a raw format that we get from WhatsApp. May be changed anytime, use it with caution! It depends a lot on the underlying backend.', | |
| }) | |
| _data?: any; | |
| } | |