3.3.0 • Published 1 year ago

@open-wa/wa-automate-socket-client v3.3.0

Weekly downloads
-
License
H-DNH V1.0
Repository
github
Last release
1 year ago

Remote Socket Client

How to:

  1. Run the EASY API
> npx @open-wa/wa-automate --socket -p 8002 -k api_key

Note: --socket flag is required!!

  1. Typescript code:
import {
    Client,
    SocketClient,
} from "@open-wa/wa-automate-socket-client";

const NUMBER = 'TEST_PHONE_NUMBER@c.us'

const start = async () => {
    const client = await SocketClient.connect(
        "http://localhost:8002",
        "api_key"
    ) as SocketClient & Client;

    client.onAnyMessage((message) => {
        console.log("onAnyMessage", message.id, message.body);
    });

    const socketId = client.socket.id;
    console.log("🚀 ~ file: client.ts ~ line 144 ~ start ~ socketId", socketId);

    console.log(
        "Connected!",
        await client.sendText(NUMBER, "this is a text")
    );
    client
        .sendAudio(
            NUMBER,
            "https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"
        )
        .then((audoMessageId) => console.log(audoMessageId));

    console.log(
        await client.sendFile(
            NUMBER,
            "https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4",
            "test.mp4",
            "hellow"
        )
    );
};

start();
3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

3 years ago

1.0.2

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago