Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcardeenas authored Apr 4, 2020
1 parent bdd4652 commit 3a6aadf
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,33 @@ client.onStateChange((state) => {
await client.sendMessageToId('[email protected]', 'Hello from sulla! 👋')
```

#### Multiple sessions
If you need to run multiple sessions at once just pass a session name to `create()` method.
```javascript
async () => {
const marketingClient = await sulla.create('marketing');
const salesClient = await sulla.create('sales');
const supportClient = await sulla.create('support');
}
```

#### Closing (saving) sessions
Close the session properly to ensure the session is saved for the next time you log in (So it wont ask for QR scan again).
So instead of CTRL+C,
```javascript
// Catch ctrl+C
process.on('SIGINT', function() {
client.close();
});

// Try-catch close
try {
...
} catch (error) {
client.close();
}
```

## Maintainers
Maintainers are needed, I cannot keep with all the updates by myself. If you are interested please open a Pull Request.

Expand Down

0 comments on commit 3a6aadf

Please sign in to comment.