fix: Corregir imports de Baileys para ESM/CJS
Some checks failed
build-and-deploy / build-and-deploy (push) Has been cancelled
Some checks failed
build-and-deploy / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -3,10 +3,14 @@
|
||||
* Stores credentials and keys in the database instead of files
|
||||
*/
|
||||
import type { AuthenticationCreds, SignalDataTypeMap } from '@whiskeysockets/baileys'
|
||||
import pkg from '@whiskeysockets/baileys'
|
||||
const { initAuthCreds, BufferJSON, proto } = pkg
|
||||
import * as baileys from '@whiskeysockets/baileys'
|
||||
import { query } from '../../utils/database'
|
||||
|
||||
// Get functions from baileys module
|
||||
const initAuthCreds = (baileys as any).initAuthCreds || (baileys as any).default?.initAuthCreds
|
||||
const BufferJSON = (baileys as any).BufferJSON || (baileys as any).default?.BufferJSON
|
||||
const proto = (baileys as any).proto || (baileys as any).default?.proto
|
||||
|
||||
export interface PostgresAuthState {
|
||||
state: {
|
||||
creds: AuthenticationCreds
|
||||
|
||||
Reference in New Issue
Block a user