feat: Setting background synchronization (#3331)

* Changing the background synchronization setting

* add  example

* return function

* style: add clarification note

---------

Co-authored-by: alechkos <93551621+alechkos@users.noreply.github.com>
Co-authored-by: Shir Serlui <70711723+shirser121@users.noreply.github.com>
This commit is contained in:
tofers 2025-05-30 11:06:08 +03:00 • committed by GitHub
commit c0ba5e545b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 3 deletions

View file

@ -470,6 +470,10 @@ client.on('message', async msg => {
console.log(statuses);
const chat = await statuses[0]?.getChat(); // Get user chat of a first status
console.log(chat);
} else if (msg.body === '!changeSync') {
// NOTE: this action will take effect after you restart the client.
const backgroundSync = await client.setBackgroundSync(true);
console.log(backgroundSync);
}
});