Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python socket github

from wa_automate_socket_client import SocketClient

NUMBER = 'TEST_PHONE_NUMBER@c.us'

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()
Comment

PREVIOUS NEXT
Code Example
Python :: how to get all distinct substrings in a string python 
Python :: how to change theme of jupyter notebook 
Python :: classes in python 
Python :: python crosshair overlay 
Python :: python should i use getters and setters 
Python :: get value of property of object with name python 
Python :: git clone in python to tmp directory 
Python :: Python NumPy ndarray.T Example to convert an array 
Python :: use rclone on colab 
Python :: python ascii() 
Python :: map in python 
Python :: s=0 def sum(x,y): n=int(input("enter no. of terms") for i in range(n): l=int(input("enter no.")) s=s+l print(s) sum() 
Python :: DJANGO model instance get by variable 
Python :: python website example 
Python :: bst deleting in python 
Python :: displaying data from this column where value is this python 
Python :: from Player import Player 
Python :: python % meaning 
Python :: searching for best k values in knn 
Python :: seaborn heatmap center xticks 
Python :: create smtp server python 
Python :: convert string ranges list python 
Python :: python inspect.getsource 
Python :: get all subarrays of an array python 
Python :: pyad create user 
Python :: string in netcdf file python 
Python :: mid-point circle drawing 
Python :: make array consecutive 2 python 
Python :: read file from drive in colab 
Python :: looping over dictionary python 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =