> For the complete documentation index, see [llms.txt](https://zalojs.gitbook.io/docs-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zalojs.gitbook.io/docs-1/general.md).

# General

<figure><img src="/files/onJ1jCQlqbwp0Qa4SNlN" alt=""><figcaption></figcaption></figure>

### General

***Unstable , unreliable , minimalist Zalo Scraper library for Nodejs***

#### About The Project <a href="#about-the-project" id="about-the-project"></a>

ZaloJS is a powerful high-level scraping API designed for accessing data from Zalo, a popular messaging platform in Vietnam. This versatile tool provides developers with the means to extract various types of data from Zalo, enabling them to build applications, gather insights, and automate tasks effectively.

**Use Cases**

* Chatbot Development: Develop chatbots capable of interacting with Zalo users, responding to messages, providing information, and executing tasks.
* Automated Workflows: Streamline repetitive tasks by automating actions within the Zalo client, such as sending notifications or gathering data.

**Example Use**

```javascript
const { init } = require('zalojs');
const config = require('./config.json');
const Client = require('zalojs').default;
const fs = require('fs');
const path = require('path');

const prefix = '!';

(async () => {
  const { browser, page } = await init({
    groupName: config.gname,
    groupID: config.gselector,
    headless: config.headless,
  });

  const client = new Client(page);

  client.on('message', async (message) => {

    if (!message.content.startsWith(prefix)) return;
    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const commandName = args.shift().toLowerCase();

    try {
    if (command === 'ping') {
      await client.send({ message :'!Pong' });
    }
    } catch (error) {
      console.log(error);
      await client.send({ message :'There was an error executing the command.' });
    }
  });

  client.once('ready', () => {
    console.log(`Bot is ready! ${client.user.name}`);
  });
})();
```

[NextGetting Started](https://3040133522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPeifOhXAyI8EOHuWYxvB%2Fuploads%2FIj1NfbYhYUv5Jieksfsl%2Fgetting%20started?alt=media)

Last updated 3 days ago
