mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
add image+video+sticker dimensions
This commit is contained in:
@@ -57,27 +57,31 @@ type Buttonable = {
|
||||
/** add buttons to the message */
|
||||
buttons?: proto.IButton[]
|
||||
}
|
||||
type WithDimensions = {
|
||||
width?: number
|
||||
height?: number
|
||||
}
|
||||
export type MediaType = 'image' | 'video' | 'sticker' | 'audio' | 'document'
|
||||
export type AnyMediaMessageContent = (
|
||||
({
|
||||
image: WAMediaUpload
|
||||
caption?: string
|
||||
jpegThumbnail?: string
|
||||
} & Mentionable & Buttonable) |
|
||||
} & Mentionable & Buttonable & WithDimensions) |
|
||||
({
|
||||
video: WAMediaUpload
|
||||
caption?: string
|
||||
gifPlayback?: boolean
|
||||
jpegThumbnail?: string
|
||||
} & Mentionable & Buttonable) | {
|
||||
} & Mentionable & Buttonable & WithDimensions) | {
|
||||
audio: WAMediaUpload
|
||||
/** if set to true, will send as a `voice note` */
|
||||
pttAudio?: boolean
|
||||
/** optionally tell the duration of the audio */
|
||||
seconds?: number
|
||||
} | {
|
||||
sticker: WAMediaUpload
|
||||
} | ({
|
||||
sticker: WAMediaUpload
|
||||
} & WithDimensions) | ({
|
||||
document: WAMediaUpload
|
||||
mimetype: string
|
||||
fileName?: string
|
||||
|
||||
@@ -120,6 +120,7 @@ export const prepareWAMessageMedia = async(
|
||||
fileEncSha256,
|
||||
fileSha256,
|
||||
fileLength,
|
||||
|
||||
...uploadData
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user