diff options
| author | 2018-08-31 10:50:37 +0100 | |
|---|---|---|
| committer | 2018-08-31 10:50:37 +0100 | |
| commit | abed9cf4ea71dcbad2dd2c049683b8d14b942e09 (patch) | |
| tree | 3e40caf63fa7e1500469f4ad9a0c45c51808aad4 /modules/upc.py | |
| parent | Fix a copy paste fail in IRCLineHandler that caused PARTs to be handled as QUITs (diff) | |
| signature | ||
Reformat
Diffstat (limited to 'modules/upc.py')
| -rw-r--r-- | modules/upc.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/modules/upc.py b/modules/upc.py index 37588481..96e53042 100644 --- a/modules/upc.py +++ b/modules/upc.py @@ -2,8 +2,10 @@ import Utils UPCITEMDB_URL = "https://api.upcitemdb.com/prod/trial/lookup" + class Module(object): _name = "UPC" + def __init__(self, bot): self.bot = bot bot.events.on("received").on("command").on( @@ -18,8 +20,8 @@ class Module(object): return page = Utils.get_url(UPCITEMDB_URL, - get_params={"upc": event["args_split"][0]}, - json=True) + get_params={"upc": event["args_split"][0]}, + json=True) if page: if not len(page["items"]): event["stderr"].write("UPC/EAN not found") @@ -47,7 +49,8 @@ class Module(object): lowest_price, highest_price, currency) event["stdout"].write("%s%s%s(weight: %s" - ", size: %s, price: %s)" % ( - brand, title, description, weight, size, pricing)) + ", size: %s, price: %s)" % ( + brand, title, description, weight, size, + pricing)) else: event["stderr"].write("Failed to load results") |
