Team Ai
Apppublic

oex2003/evolution-api

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
sendMessage.dto.ts170 linesDownload Raw Back to dto
1import { proto, WAPresence } from 'baileys';2 3export class Quoted {4  key: proto.IMessageKey;5  message: proto.IMessage;6}7 8export class Options {9  delay?: number;10  presence?: WAPresence;11  quoted?: Quoted;12  linkPreview?: boolean;13  encoding?: boolean;14  mentionsEveryOne?: boolean;15  mentioned?: string[];16  webhookUrl?: string;17}18 19export class MediaMessage {20  mediatype: MediaType;21  mimetype?: string;22  caption?: string;23  // for document24  fileName?: string;25  // url or base6426  media: string;27}28 29export class StatusMessage {30  type: string;31  content: string;32  statusJidList?: string[];33  allContacts?: boolean;34  caption?: string;35  backgroundColor?: string;36  font?: number;37}38 39export class Metadata {40  number: string;41  delay?: number;42  quoted?: Quoted;43  linkPreview?: boolean;44  mentionsEveryOne?: boolean;45  mentioned?: string[];46  encoding?: boolean;47  notConvertSticker?: boolean;48}49 50export class SendTextDto extends Metadata {51  text: string;52}53export class SendPresence extends Metadata {54  text: string;55}56 57export class SendStatusDto extends Metadata {58  type: string;59  content: string;60  statusJidList?: string[];61  allContacts?: boolean;62  caption?: string;63  backgroundColor?: string;64  font?: number;65}66 67export class SendPollDto extends Metadata {68  name: string;69  selectableCount: number;70  values: string[];71  messageSecret?: Uint8Array;72}73 74export type MediaType = 'image' | 'document' | 'video' | 'audio' | 'ptv';75 76export class SendMediaDto extends Metadata {77  mediatype: MediaType;78  mimetype?: string;79  caption?: string;80  // for document81  fileName?: string;82  // url or base6483  media: string;84}85 86export class SendPtvDto extends Metadata {87  video: string;88}89 90export class SendStickerDto extends Metadata {91  sticker: string;92}93 94export class SendAudioDto extends Metadata {95  audio: string;96}97 98export type TypeButton = 'reply' | 'copy' | 'url' | 'call' | 'pix';99 100export type KeyType = 'phone' | 'email' | 'cpf' | 'cnpj' | 'random';101 102export class Button {103  type: TypeButton;104  displayText?: string;105  id?: string;106  url?: string;107  copyCode?: string;108  phoneNumber?: string;109  currency?: string;110  name?: string;111  keyType?: KeyType;112  key?: string;113}114 115export class SendButtonsDto extends Metadata {116  thumbnailUrl?: string;117  title: string;118  description?: string;119  footer?: string;120  buttons: Button[];121}122 123export class SendLocationDto extends Metadata {124  latitude: number;125  longitude: number;126  name?: string;127  address?: string;128}129 130class Row {131  title: string;132  description: string;133  rowId: string;134}135class Section {136  title: string;137  rows: Row[];138}139export class SendListDto extends Metadata {140  title: string;141  description?: string;142  footerText?: string;143  buttonText: string;144  sections: Section[];145}146 147export class ContactMessage {148  fullName: string;149  wuid: string;150  phoneNumber: string;151  organization?: string;152  email?: string;153  url?: string;154}155 156export class SendTemplateDto extends Metadata {157  name: string;158  language: string;159  components: any;160  webhookUrl?: string;161}162export class SendContactDto extends Metadata {163  contact: ContactMessage[];164}165 166export class SendReactionDto {167  key: proto.IMessageKey;168  reaction: string;169}170