-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdd4652
commit 3a6aadf
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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. | ||
|
||
|