Skip to content

Commit

Permalink
fix: added missing properties to the Message type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
gekkedev authored Jun 26, 2024
1 parent af74e7c commit dfec33a
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions src/api/model/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
*/

import { Wid } from './wid';
import { Chat } from './chat';
import { Contact } from './contact';
import { MessageType } from './enum';
Expand All @@ -30,6 +31,7 @@ export interface Message {
*/
subtype: string;
t: number;
/** profile alias chosen by the sender */
notifyName: string;
from: string;
to: string;
Expand All @@ -39,6 +41,7 @@ export interface Message {
invis: boolean;
isNewMsg: boolean;
star: boolean;
kicNotified: boolean;
recvFresh: boolean;
interactiveAnnotations: any[];
clientUrl: string;
Expand All @@ -53,9 +56,40 @@ export interface Message {
width: number;
height: number;
broadcast: boolean;
mentionedJidList: any[];
/** array of the users who were mentioned in this message; given in the serialized format: "[email protected]" / "[email protected]" */
mentionedJidList: string[];
isVcardOverMmsDocument: boolean;
/** exists when `type` is set to {@link MessageType.VCARD}; it is the name of the sent contact */
vcardFormattedName?: string;
isForwarded: boolean;
labels: any[];
hasReaction: boolean;
productHeaderImageRejected: boolean;
lastPlaybackProgress: number;
isDynamicReplyButtonsMsg: boolean;
isCarouselCard: boolean;
parentMsgId: any; //TODO: specify the type, `null` spotted often
isMdHistoryMsg: boolean;
stickerSentTs: number;
isAvatar: boolean;
lastUpdateFromServerTs: number;
invokedBotWid: null | WID;

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'invokedBotWid'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'WID'. Did you mean 'Wid'?

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Property 'invokedBotWid' of exported interface has or is using private name 'WID'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'invokedBotWid'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Cannot find name 'WID'. Did you mean 'Wid'?

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Property 'invokedBotWid' of exported interface has or is using private name 'WID'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Duplicate identifier 'invokedBotWid'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Cannot find name 'WID'. Did you mean 'Wid'?

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Property 'invokedBotWid' of exported interface has or is using private name 'WID'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Duplicate identifier 'invokedBotWid'.

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Cannot find name 'WID'. Did you mean 'Wid'?

Check failure on line 75 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Property 'invokedBotWid' of exported interface has or is using private name 'WID'.
invokedBotWid: null; //TODO: amend this type definition

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'invokedBotWid'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Subsequent property declarations must have the same type. Property 'invokedBotWid' must be of type 'any', but here has type 'null'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Duplicate identifier 'invokedBotWid'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / build

Subsequent property declarations must have the same type. Property 'invokedBotWid' must be of type 'any', but here has type 'null'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Duplicate identifier 'invokedBotWid'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Subsequent property declarations must have the same type. Property 'invokedBotWid' must be of type 'any', but here has type 'null'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Duplicate identifier 'invokedBotWid'.

Check failure on line 76 in src/api/model/message.ts

View workflow job for this annotation

GitHub Actions / lint

Subsequent property declarations must have the same type. Property 'invokedBotWid' must be of type 'any', but here has type 'null'.
bizBotType: null; //TODO: amend this type definition
botResponseTargetId: null; //TODO: amend this type definition
botPluginType: null; //TODO: amend this type definition
botPluginReferenceIndex: null; //TODO: amend this type definition
botPluginSearchProvider: null; //TODO: amend this type definition
botPluginSearchUrl: null; //TODO: amend this type definition
botPluginSearchQuery: null; //TODO: amend this type definition
botPluginMaybeParent: boolean;
botReelPluginThumbnailCdnUrl: null; //TODO: amend this type definition
botMsgBodyType: null; //TODO: amend this type definition
requiresDirectConnection: null; //TODO: amend this type definition
bizContentPlaceholderType: null; //TODO: amend this type definition
hostedBizEncStateMismatch: boolean;
senderOrRecipientAccountTypeHosted: boolean;
placeholderCreatedWhenAccountIsHosted: boolean;
labels?: any[];
sender: Contact;
timestamp: number;
content: string;
Expand All @@ -70,6 +104,7 @@ export interface Message {
chat: Chat;
lastSeen: null | number | boolean;
chatId: string;
fromMe: boolean;
/**
* @deprecated Use the `quotedMsgId` attribute in `getMessageById` to get the message details
*/
Expand Down

0 comments on commit dfec33a

Please sign in to comment.