baileys-conversation
v0.0.5
Published
Allow baileys to save conversation (text only)
Downloads
3
Readme
baileys conversation
Description
This package is for stores baileys conversation to MongoDB.
Installation
yarn add baileys-conversation
Usage
import { useMongoConversation } from 'baileys-conversation'
import mongoose from 'mongoose'
import makeWASocket from '@adiwajshing/baileys'
async function main() {
await mongoose.connect(process.env.MONGO_URI)
const connection = mongoose.connection
await startSocket(connection)
}
async function startSocket(connection) {
const conversation = useMongoConversation(connection, {
ignoreFromMe: false,
ignoreJids: [
// '[email protected]'
],
ignoreMessage: (message) => false,
})
const sock = makeWASocket({})
conversation.binding(socket)
// ...
return sock
}
main()