We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c57f6fc commit faef1b6Copy full SHA for faef1b6
1 file changed
plugins/books.py
@@ -21,8 +21,11 @@ def books(text):
21
22
json = requests.get(book_search_api, params={"q": text, "key": dev_key}).json()
23
24
- if 'error' in json:
25
- return 'Error performing search.'
+ if json.get('error'):
+ if json['error']['code'] == 403:
26
+ return "The Books API is off in the Google Developers Console."
27
+ else:
28
+ return 'Error performing search.'
29
30
if json['totalItems'] == 0:
31
return 'No results found.'
0 commit comments