aboutsummaryrefslogtreecommitdiff
path: root/modules/books.py
diff options
context:
space:
mode:
Diffstat (limited to 'modules/books.py')
-rw-r--r--modules/books.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/books.py b/modules/books.py
index 5f7c0627..f27247dd 100644
--- a/modules/books.py
+++ b/modules/books.py
@@ -5,8 +5,10 @@ URL_GOOGLEBOOKS = "https://www.googleapis.com/books/v1/volumes"
URL_BOOKINFO = "https://books.google.co.uk/books?id=%s"
REGEX_BOOKID = re.compile("id=([\w\-]+)")
+
class Module(object):
_name = "ISBN"
+
def __init__(self, bot):
self.bot = bot
bot.events.on("received").on("command").on("isbn").hook(
@@ -24,7 +26,7 @@ class Module(object):
book = page["items"][0]["volumeInfo"]
title = book["title"]
sub_title = (", %s" % book.get("subtitle")
- ) if book.get("subtitle") else ""
+ ) if book.get("subtitle") else ""
authors = ", ".join(book.get("authors", []))
authors = " - %s" % authors if authors else ""