feat: group mentions + improved user mentions (#2602)

* added logic to mention groups + fixed user mentions

* usage example updated

* docs fixed

* window.injectToFunction clarifications

* usage example clarifications

* fix: typo

* docs: added missed docs
This commit is contained in:
alechkos 2024-01-11 10:33:10 +02:00 • committed by GitHub
commit e0d955f130
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

24
index.d.ts vendored
View file

@ -857,7 +857,16 @@ declare namespace WAWebJS {
/** MediaKey that represents the sticker 'ID' */
mediaKey?: string,
/** Indicates the mentions in the message body. */
mentionedIds: [],
mentionedIds: ChatId[],
/** Indicates whether there are group mentions in the message body */
groupMentions: {
groupSubject: string;
groupJid: {
server: string;
user: string;
_serialized: string;
};
}[],
/** Unix timestamp for when the message was created */
timestamp: number,
/**
@ -917,6 +926,8 @@ declare namespace WAWebJS {
getContact: () => Promise<Contact>,
/** Returns the Contacts mentioned in this message */
getMentions: () => Promise<Contact[]>,
/** Returns groups mentioned in this message */
getGroupMentions: () => Promise<GroupChat[]|[]>,
/** Returns the quoted message, if any */
getQuotedMessage: () => Promise<Message>,
/**
@ -1039,8 +1050,15 @@ declare namespace WAWebJS {
caption?: string
/** Id of the message that is being quoted (or replied to) */
quotedMessageId?: string
/** Contacts that are being mentioned in the message */
mentions?: Contact[]
/** User IDs to mention in the message */
mentions?: string[]
/** An array of object that handle group mentions */
groupMentions?: {
/** The name of a group to mention (can be custom) */
subject: string,
/** The group ID, e.g.: 'XXXXXXXXXX@g.us' */
id: string
}[]
/** Send 'seen' status */
sendSeen?: boolean
/** Media to be sent */