joaoricardo000 / whatsapp-bot-seed

A small python framework to create a whatsapp bot, with regex-callback message routing.
730 stars 243 forks source link

Search command not working #84

Open haxxorsid opened 8 years ago

haxxorsid commented 8 years ago
python src/server.py
_server.py_ [INFO][2016-06-10 00:10:06,116] ##################################################
_server.py_ [INFO][2016-06-10 00:10:06,117]     Server started. Phone number: 919004094663
_server.py_ [INFO][2016-06-10 00:10:06,117] ##################################################
_router.py_ [INFO][2016-06-10 00:10:45,975] (PVT)[917039887080@s.whatsapp.net]  /search ok
_connectionpool.py_ [INFO][2016-06-10 00:10:45,981] Starting new HTTP connection (1): ajax.googleapis.com
_router.py_ [ERROR][2016-06-10 00:10:46,591] Error routing message: /search ok
Message:
ID: 4E9789BA1DF836713F51A3852A95CC
From: 917039887080@s.whatsapp.net
Type:  text
Timestamp: 1465497646
Body: /search ok
Traceback (most recent call last):
  File "/root/Desktop/whatsapp-bot-seed-master/src/router.py", line 76, in handle_callback
    data = callback(message, match)
  File "/root/Desktop/whatsapp-bot-seed-master/src/views/google.py", line 29, in google_search
    page_url = urllib.unquote(req.json()["responseData"]["results"][0]["url"])
TypeError: 'NoneType' object has no attribute '__getitem__'

I get this error when I use /search