wppconnect-team / wppconnect

WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination
https://wppconnect.io
Other
1.92k stars 338 forks source link

fix: chat opening methods accept a Wid param #2411

Open gekkedev opened 2 weeks ago

gekkedev commented 2 weeks ago

These 2 methods appear to support Wid as input param. References from wa-js:

Additional change: The return type of getActiveChat() appears to be:

Promise<import("@wppconnect/wa-js/dist/whatsapp").ChatModel>

but VSCode and tsc disagree with me (not knowing the type (imported by and imported library from a different library, maybe that's why):

error TS2740: Type 'Promise<any>' is missing the following properties from type 'Chat': id, pendingMsgs, lastReceivedKey, t, and 23 more.

Feel free to revert 9c30eec8e8ffac8e06c46e3dc028dbc64f5cfafb if there is a better solution (i.e. if fixing it on wa-js side is possible).