mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: add support to ptvMessage in sendMessage method (#738)
* add support to ptvMessage in sendMessage method * fix(ptv-sendmessage): Eslint --------- Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
@@ -116,6 +116,8 @@ export type AnyMediaMessageContent = (
|
|||||||
caption?: string
|
caption?: string
|
||||||
gifPlayback?: boolean
|
gifPlayback?: boolean
|
||||||
jpegThumbnail?: string
|
jpegThumbnail?: string
|
||||||
|
/** if set to true, will send as a `video note` */
|
||||||
|
ptv?: boolean
|
||||||
} & Mentionable & Contextable & Buttonable & Templatable & WithDimensions)
|
} & Mentionable & Contextable & Buttonable & Templatable & WithDimensions)
|
||||||
| {
|
| {
|
||||||
audio: WAMediaUpload
|
audio: WAMediaUpload
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ type MediaUploadData = {
|
|||||||
media: WAMediaUpload
|
media: WAMediaUpload
|
||||||
caption?: string
|
caption?: string
|
||||||
ptt?: boolean
|
ptt?: boolean
|
||||||
|
ptv?: boolean
|
||||||
seconds?: number
|
seconds?: number
|
||||||
gifPlayback?: boolean
|
gifPlayback?: boolean
|
||||||
fileName?: string
|
fileName?: string
|
||||||
@@ -254,6 +255,11 @@ export const prepareWAMessageMedia = async(
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if(uploadData.ptv) {
|
||||||
|
obj.ptvMessage = obj.videoMessage
|
||||||
|
delete obj.videoMessage
|
||||||
|
}
|
||||||
|
|
||||||
if(cacheableKey) {
|
if(cacheableKey) {
|
||||||
logger?.debug({ cacheableKey }, 'set cache')
|
logger?.debug({ cacheableKey }, 'set cache')
|
||||||
options.mediaCache!.set(cacheableKey, WAProto.Message.encode(obj).finish())
|
options.mediaCache!.set(cacheableKey, WAProto.Message.encode(obj).finish())
|
||||||
|
|||||||
Reference in New Issue
Block a user