Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mr687/baileys-conversation


https://github.com/mr687/baileys-conversation

Last synced: 27 days ago
JSON representation

Awesome Lists containing this project

README

        

# baileys conversation

## Description

This package is for stores baileys conversation to MongoDB.

## Installation

```bash
yarn add baileys-conversation
```

## Usage

```ts
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()
```