GithubHelp home page GithubHelp logo

vincentbuck / wa-automate-socket-client-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-wa/wa-automate-socket-client-python

0.0 0.0 0.0 16 KB

๐Ÿ”Œ ๐Ÿ›  The wa-automate socket client allows you to easily connect to remote EASY API instances. Be sure to ๐ŸŒŸ this repository for updates!

License: Other

Python 100.00%

wa-automate-socket-client-python's Introduction

Remote Socket Client

How to:

  1. Run the EASY API. Note: --socket flag is required!!
> npx @open-wa/wa-automate --socket -p 8085 -k secure_api_key

# OR use docker

> docker run openwa/wa-automate --socket -p 8085 -k secure_api_key
  1. Install
> pip install wa-automate-socket-client
  1. Sample code:
from wa_automate_socket_client import SocketClient

NUMBER = '[email protected]'

client = SocketClient('http://localhost:8085/', 'secure_api_key')


def printResponse(message):
    print(message)


# Listening for events
client.onMessage(printResponse)

# Executing commands
client.sendText(NUMBER, "this is a text")

# Sync/Async support
print(client.getHostNumber())  # Sync request
client.sendAudio(NUMBER,
                 "https://download.samplelib.com/mp3/sample-3s.mp3",
                 sync=False,
                 callback=printResponse)  # Async request. Callback is optional

# Finally disconnect
client.disconnect()

wa-automate-socket-client-python's People

Contributors

mrodal avatar smashah avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.