mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Add support for stream as media message input (#905)
* Add support for stream as media message input * refactor: use async/await on readable toBuffer * refactor: be more explicit about using a readable stream Co-authored-by: Adhiraj Singh <adhirajsingh1001@gmail.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import type { Logger } from "pino"
|
||||
import type { URL } from "url"
|
||||
import type NodeCache from "node-cache"
|
||||
import type { GroupMetadata } from "./GroupMetadata"
|
||||
import type { Readable } from "stream"
|
||||
import { proto } from '../../WAProto'
|
||||
|
||||
// export the WAMessage Prototypes
|
||||
@@ -18,7 +19,7 @@ export type WALocationMessage = proto.ILocationMessage
|
||||
export type WAGenericMediaMessage = proto.IVideoMessage | proto.IImageMessage | proto.IAudioMessage | proto.IDocumentMessage | proto.IStickerMessage
|
||||
export import WAMessageStubType = proto.WebMessageInfo.WebMessageInfoStubType
|
||||
export import WAMessageStatus = proto.WebMessageInfo.WebMessageInfoStatus
|
||||
export type WAMediaUpload = Buffer | { url: URL | string }
|
||||
export type WAMediaUpload = Buffer | { url: URL | string } | { stream: Readable }
|
||||
/** Set of message types that are supported by the library */
|
||||
export type MessageType = keyof proto.Message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user