Comments (8)
We are planning to add an easier way to create bots, like a hook or a callback.
import time
from webwhatsapp import WhatsAPIDriver
driver = WhatsAPIDriver()
# Waits for page to initialize completely
driver.firstrun()
print "bot started!"
while True:
#polling period
time.sleep(1)
contacts = driver.view_unread();
for contact in contacts:
##filters here
if "Mom" in contact[u"contact"]:
##iterating through recent messages
for message in contact[u"messages"]:
##message here
print message
driver.send_to_id(contact[u"id"], contact[u"contact"], "hello" + message[u"message"])
from webwhatsapp-wrapper.
wow ! , It's great what they've created me I liked it, thank you for the example , dear thank you very much !
from webwhatsapp-wrapper.
@mukulhase
AttributeError: WhatsAPIDriver instance has no attribute 'send_to_id'
from webwhatsapp-wrapper.
bot started {u'timestamp': 1470091884, u'message': u'tengo pokemon go pero no me saleniun pokemos'} Traceback (most recent call last): File "bot.py", line 16, in <module> driver.send_to_id(contact[u"id"], contact[u"contact"], "hello" + message[u"message"]) AttributeError: WhatsAPIDriver instance has no attribute 'send_to_id'
from webwhatsapp-wrapper.
I'm not getting this error, could you please check if you are using the latest code?
from webwhatsapp-wrapper.
@mukulhase sorry this error was because im not update code .. sorry my inglish :C
from webwhatsapp-wrapper.
@mukulhase I am getting below error . How can we resolve these issue.
bot started!
Traceback (most recent call last):
File "E:\Python\WhatsAPI-master\sample.py", line 13, in
contacts = driver.view_unread();
File "E:\Python\WhatsAPI-master\webwhatsapp.py", line 152, in view_unread
Store = self.driver.execute_script(script)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\selenium\webdriver\remote\webdriver.py", line 465, in execute_script
'args': converted_args})['value']
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\selenium\webdriver\remote\webdriver.py", line 234, in execute
response = self.command_executor.execute(driver_command, params)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\selenium\webdriver\remote\remote_connection.py", line 401, in execute
return self._request(command_info[0], url, body=data)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\site-package
s\selenium\webdriver\remote\remote_connection.py", line 432, in _request
self._conn.request(method, parsed_url.path, body, headers)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\http\client.
py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\http\client.
py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\http\client.
py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\http\client.
py", line 1026, in _send_output
self.send(msg)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\http\client.
py", line 964, in send
self.connect()
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\http\client.
py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\socket.py",
line 722, in create_connection
raise err
File "C:\Users\AMIT\AppData\Local\Programs\Python\Python36-32\lib\socket.py",
line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the
target machine actively refused it
from webwhatsapp-wrapper.
hello, i'm trying to use the API, but i have a doubt.
What is the variable Store on get_unread_messages.js script?
can i change the value of it? Just to get selected chat?
from webwhatsapp-wrapper.
Related Issues (20)
- Chromium Not opening web whatsapp
- How can I send a vcard or contact to a chat? It doesn't work. HOT 4
- javascript error: circular reference HOT 1
- Does anyone know how can I send a reaction to a message? HOT 1
- Problem In implementation
- https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/23#issuecomment-355776501 HOT 1
- New WhatsApp version ? Broken contacts and undefined attributes HOT 1
- window.WAPI doesn't exist HOT 2
- window.WAPI.sendImage is not working in chrome after chrome and whatsApp update HOT 5
- Error for read new messages HOT 3
- getbaterrylevel is not working
- Make call on whatsapp and play pre recorded audio when call connect
- cannot read properties of undefined (reading 'sendmessage') for numbers not in contact list HOT 3
- TypeError: __init__() got an unexpected keyword argument 'desired_capabilities' HOT 1
- circular reference - get_all_chats
- Uncaught ReferenceError: webpackChunkwhatsapp_web_client is not defined HOT 16
- Uncaught TypeError: window.Store is undefined HOT 1
- error cannot read properties of indenfined (reading chat) HOT 1
- not getting any chats in WAPI and WAPI.isLoggedIn() is not working HOT 1
- Error in function getAllMessageIdsInChat
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webwhatsapp-wrapper.