feat: pass cachedGroupMetadata from sendMessage

This commit is contained in:
Adhiraj Singh
2022-05-23 11:32:51 +05:30
parent 7e290b4dfb
commit e131b7c4d3
2 changed files with 15 additions and 10 deletions

View File

@@ -131,27 +131,28 @@ export type AnyMessageContent = AnyRegularMessageContent | {
export type GroupMetadataParticipants = Pick<GroupMetadata, 'participants'>
export type MessageRelayOptions = {
type MinimalRelayOptions = {
/** override the message ID with a custom provided string */
messageId?: string
/** only send to a specific participant; used when a message decryption fails for a single user */
participant?: string
/** additional attributes to add to the WA binary node */
additionalAttributes?: { [_: string]: string }
/** cached group metadata, use to prevent redundant requests to WA & speed up msg sending */
cachedGroupMetadata?: (jid: string) => Promise<GroupMetadataParticipants | undefined>
}
export type MiscMessageGenerationOptions = {
/** Force message id */
messageId?: string
export type MessageRelayOptions = MinimalRelayOptions & {
/** only send to a specific participant; used when a message decryption fails for a single user */
participant?: string
/** additional attributes to add to the WA binary node */
additionalAttributes?: { [_: string]: string }
}
export type MiscMessageGenerationOptions = MinimalRelayOptions & {
/** optional, if you want to manually set the timestamp of the message */
timestamp?: Date
/** the message you want to quote */
quoted?: WAMessage
/** disappearing messages settings */
ephemeralExpiration?: number | string
/** timeout for media upload to WA server */
mediaUploadTimeoutMs?: number
}
export type MessageGenerationOptionsFromContent = MiscMessageGenerationOptions & {