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
|
||||
gifPlayback?: boolean
|
||||
jpegThumbnail?: string
|
||||
/** if set to true, will send as a `video note` */
|
||||
ptv?: boolean
|
||||
} & Mentionable & Contextable & Buttonable & Templatable & WithDimensions)
|
||||
| {
|
||||
audio: WAMediaUpload
|
||||
|
||||
@@ -32,6 +32,7 @@ type MediaUploadData = {
|
||||
media: WAMediaUpload
|
||||
caption?: string
|
||||
ptt?: boolean
|
||||
ptv?: boolean
|
||||
seconds?: number
|
||||
gifPlayback?: boolean
|
||||
fileName?: string
|
||||
@@ -254,6 +255,11 @@ export const prepareWAMessageMedia = async(
|
||||
)
|
||||
})
|
||||
|
||||
if(uploadData.ptv) {
|
||||
obj.ptvMessage = obj.videoMessage
|
||||
delete obj.videoMessage
|
||||
}
|
||||
|
||||
if(cacheableKey) {
|
||||
logger?.debug({ cacheableKey }, 'set cache')
|
||||
options.mediaCache!.set(cacheableKey, WAProto.Message.encode(obj).finish())
|
||||
|
||||
Reference in New Issue
Block a user