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 */
|
/** add buttons to the message */
|
||||||
buttons?: proto.IButton[]
|
buttons?: proto.IButton[]
|
||||||
}
|
}
|
||||||
|
type WithDimensions = {
|
||||||
|
width?: number
|
||||||
|
height?: number
|
||||||
|
}
|
||||||
export type MediaType = 'image' | 'video' | 'sticker' | 'audio' | 'document'
|
export type MediaType = 'image' | 'video' | 'sticker' | 'audio' | 'document'
|
||||||
export type AnyMediaMessageContent = (
|
export type AnyMediaMessageContent = (
|
||||||
({
|
({
|
||||||
image: WAMediaUpload
|
image: WAMediaUpload
|
||||||
caption?: string
|
caption?: string
|
||||||
jpegThumbnail?: string
|
jpegThumbnail?: string
|
||||||
} & Mentionable & Buttonable) |
|
} & Mentionable & Buttonable & WithDimensions) |
|
||||||
({
|
({
|
||||||
video: WAMediaUpload
|
video: WAMediaUpload
|
||||||
caption?: string
|
caption?: string
|
||||||
gifPlayback?: boolean
|
gifPlayback?: boolean
|
||||||
jpegThumbnail?: string
|
jpegThumbnail?: string
|
||||||
} & Mentionable & Buttonable) | {
|
} & Mentionable & Buttonable & WithDimensions) | {
|
||||||
audio: WAMediaUpload
|
audio: WAMediaUpload
|
||||||
/** if set to true, will send as a `voice note` */
|
/** if set to true, will send as a `voice note` */
|
||||||
pttAudio?: boolean
|
pttAudio?: boolean
|
||||||
/** optionally tell the duration of the audio */
|
/** optionally tell the duration of the audio */
|
||||||
seconds?: number
|
seconds?: number
|
||||||
} | {
|
|
||||||
sticker: WAMediaUpload
|
|
||||||
} | ({
|
} | ({
|
||||||
|
sticker: WAMediaUpload
|
||||||
|
} & WithDimensions) | ({
|
||||||
document: WAMediaUpload
|
document: WAMediaUpload
|
||||||
mimetype: string
|
mimetype: string
|
||||||
fileName?: string
|
fileName?: string
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ export const prepareWAMessageMedia = async(
|
|||||||
fileEncSha256,
|
fileEncSha256,
|
||||||
fileSha256,
|
fileSha256,
|
||||||
fileLength,
|
fileLength,
|
||||||
|
|
||||||
...uploadData
|
...uploadData
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user