feat: send media as stickers (#479)

Adds the option `sendMediaAsSticker` that will take care of converting media to appropriate formats and send it as a sticker. Note that ffmpeg is required to properly convert animated stickers that are not in webp format.

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
This commit is contained in:
Marcelo Carvalho
2020-12-25 19:20:12 -03:00
committed by Pedro S. Lopez
parent 0c0a5a752b
commit e2a642a81b
7 changed files with 199 additions and 8 deletions

5
index.d.ts vendored
View File

@@ -277,6 +277,9 @@ declare namespace WAWebJS {
/** User agent to use in puppeteer.
* @default 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36' */
userAgent?: string
/** Ffmpeg path to use when formating videos to webp while sending stickers
* @default 'ffmpeg' */
ffmpegPath?: string
}
/** Represents a Whatsapp client session */
@@ -553,6 +556,8 @@ declare namespace WAWebJS {
linkPreview?: boolean
/** Send audio as voice message */
sendAudioAsVoice?: boolean
/** Send media as sticker */
sendMediaAsSticker?: boolean
/** Send media as document */
sendMediaAsDocument?: boolean
/** Automatically parse vCards and send them as contacts */