joaoricardo000 / whatsapp-bot-seed

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

Image Search Not working #81

Open haxxorsid opened 8 years ago

haxxorsid commented 8 years ago
python src/server.py
_server.py_ [INFO][2016-06-10 00:08:01,238] ##################################################
_server.py_ [INFO][2016-06-10 00:08:01,238]     Server started. Phone number: 919004094663
_server.py_ [INFO][2016-06-10 00:08:01,238] ##################################################
_router.py_ [INFO][2016-06-10 00:08:02,079] (PVT)[917039887080@s.whatsapp.net]  /image ok
_router.py_ [ERROR][2016-06-10 00:08:02,079] Error routing message: /image ok
Message:
ID: AEBBDCC2187BDE1D07998AD3DFE5F2
From: 917039887080@s.whatsapp.net
Type:  text
Timestamp: 1465497475
Body: /image 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/bing.py", line 18, in bing_image_search
    req = requests.get("https://api.datamarket.azure.com/Bing/Search/v1/Image?Query=%27{}%27&$format=json&$top=1".format(match.group("term")), auth=("",config.bing_api))
AttributeError: 'module' object has no attribute 'bing_api'

I get this error when I try to do any image search.