zaileys 4.6.2 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WAMessage, WAMessageKey, AnyMessageContent, MiscMessageGenerationOptions, Chat, Contact, PresenceData, WAPrivacyValue, WAPrivacyOnlineValue, WAReadReceiptsValue, WAPrivacyGroupAddValue, GroupMetadata, ParticipantAction, WAMediaUpload, ChatModification, NewsletterMetadata, AuthenticationCreds, SignalDataTypeMap, SignalDataSet, WASocket, UserFacingSocketConfig, SignalKeyStore, MessageUpsertType } from 'baileys';
2
- export { GroupMetadata, GroupParticipant, NewsletterMetadata, ParticipantAction, WAMediaUpload, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue, areJidsSameUser, getDevice, isJidBroadcast, isJidGroup, isJidNewsletter, isLidUser, isPnUser, jidDecode, jidEncode, jidNormalizedUser } from 'baileys';
2
+ export { AnyMessageContent, GroupMetadata, GroupParticipant, NewsletterMetadata, ParticipantAction, WAMediaUpload, WAMessage, WAMessageContent, WAMessageKey, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue, areJidsSameUser, getDevice, isJidBroadcast, isJidGroup, isJidNewsletter, isLidUser, isPnUser, jidDecode, jidEncode, jidNormalizedUser } from 'baileys';
3
3
  import { Readable } from 'node:stream';
4
4
  import { Pool } from 'pg';
5
5
  import { RedisClientType } from 'redis';
@@ -1695,6 +1695,11 @@ declare class Client extends TypedEventEmitter<ClientEventMap> {
1695
1695
  lidToPn(lid: string): Promise<string | null>;
1696
1696
  /** Resolve a phone-number JID to its `@lid` JID (uses WhatsApp's LID mapping; may hit the network). */
1697
1697
  pnToLid(pn: string): Promise<string | null>;
1698
+ /**
1699
+ * Download media bytes for a message stored in the message store (by key).
1700
+ * Tries both `fromMe` variants. `null` when the message is unknown or carries no media.
1701
+ */
1702
+ downloadMedia(key: WAMessageKey): Promise<MediaDownloadResult | null>;
1698
1703
  private lookupQuoted;
1699
1704
  private handleClose;
1700
1705
  private rejectPendingConnect;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { WAMessage, WAMessageKey, AnyMessageContent, MiscMessageGenerationOptions, Chat, Contact, PresenceData, WAPrivacyValue, WAPrivacyOnlineValue, WAReadReceiptsValue, WAPrivacyGroupAddValue, GroupMetadata, ParticipantAction, WAMediaUpload, ChatModification, NewsletterMetadata, AuthenticationCreds, SignalDataTypeMap, SignalDataSet, WASocket, UserFacingSocketConfig, SignalKeyStore, MessageUpsertType } from 'baileys';
2
- export { GroupMetadata, GroupParticipant, NewsletterMetadata, ParticipantAction, WAMediaUpload, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue, areJidsSameUser, getDevice, isJidBroadcast, isJidGroup, isJidNewsletter, isLidUser, isPnUser, jidDecode, jidEncode, jidNormalizedUser } from 'baileys';
2
+ export { AnyMessageContent, GroupMetadata, GroupParticipant, NewsletterMetadata, ParticipantAction, WAMediaUpload, WAMessage, WAMessageContent, WAMessageKey, WAPrivacyGroupAddValue, WAPrivacyOnlineValue, WAPrivacyValue, WAReadReceiptsValue, areJidsSameUser, getDevice, isJidBroadcast, isJidGroup, isJidNewsletter, isLidUser, isPnUser, jidDecode, jidEncode, jidNormalizedUser } from 'baileys';
3
3
  import { Readable } from 'node:stream';
4
4
  import { Pool } from 'pg';
5
5
  import { RedisClientType } from 'redis';
@@ -1695,6 +1695,11 @@ declare class Client extends TypedEventEmitter<ClientEventMap> {
1695
1695
  lidToPn(lid: string): Promise<string | null>;
1696
1696
  /** Resolve a phone-number JID to its `@lid` JID (uses WhatsApp's LID mapping; may hit the network). */
1697
1697
  pnToLid(pn: string): Promise<string | null>;
1698
+ /**
1699
+ * Download media bytes for a message stored in the message store (by key).
1700
+ * Tries both `fromMe` variants. `null` when the message is unknown or carries no media.
1701
+ */
1702
+ downloadMedia(key: WAMessageKey): Promise<MediaDownloadResult | null>;
1698
1703
  private lookupQuoted;
1699
1704
  private handleClose;
1700
1705
  private rejectPendingConnect;