diff options
| author | 2018-08-31 10:50:37 +0100 | |
|---|---|---|
| committer | 2018-08-31 10:50:37 +0100 | |
| commit | abed9cf4ea71dcbad2dd2c049683b8d14b942e09 (patch) | |
| tree | 3e40caf63fa7e1500469f4ad9a0c45c51808aad4 /modules/books.py | |
| parent | Fix a copy paste fail in IRCLineHandler that caused PARTs to be handled as QUITs (diff) | |
| signature | ||
Reformat
Diffstat (limited to 'modules/books.py')
| -rw-r--r-- | modules/books.py | 4 |
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 "" |
