Explicit waitForConnection + option to not load profile picture for new chats

This commit is contained in:
Adhiraj Singh
2020-10-19 15:22:44 +05:30
parent bb78138506
commit 588209d57c
4 changed files with 10 additions and 3 deletions

View File

@@ -85,6 +85,8 @@ export class WAConnection extends Base {
}
/** Prepare a media message for sending */
async prepareMessageMedia(buffer: Buffer, mediaType: MessageType, options: MessageOptions = {}) {
await this.waitForConnection ()
if (mediaType === MessageType.document && !options.mimetype) {
throw new Error('mimetype required to send a document')
}