Added support for sending + toggling disappearing messages

This commit is contained in:
Adhiraj Singh
2020-12-12 00:21:11 +05:30
parent a778f999a9
commit eb7b8506a9
6 changed files with 167 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ export const WS_URL = 'wss://web.whatsapp.com/ws'
export const DEFAULT_ORIGIN = 'https://web.whatsapp.com'
export const KEEP_ALIVE_INTERVAL_MS = 20*1000
export const WA_DEFAULT_EPHEMERAL = 7*24*60*60
// export the WAMessage Prototypes
export { proto as WAMessageProto }
@@ -224,6 +225,10 @@ export interface WAChat {
spam: 'false' | 'true'
modify_tag: string
name?: string
/** when ephemeral messages were toggled on */
eph_setting_ts?: string
/** how long each message lasts for */
ephemeral?: string
// Baileys added properties
messages: KeyedDB<WAMessage, string>
@@ -367,6 +372,9 @@ export interface MessageOptions {
forceNewMediaOptions?: boolean
/** Wait for the message to be sent to the server (default true) */
waitForAck?: boolean
/** Should it send as a disappearing messages.
* By default 'chat' -- which follows the setting of the chat */
sendEphemeral?: 'chat' | boolean
}
export interface WABroadcastListInfo {
status: number