From 5fbdef2b24b33fd872c861ab75c13050dba737ba Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Sun, 26 Aug 2018 10:46:22 -0400 Subject: [PATCH] updated to allow specifying jpg or png; clarified instructions --- README.md | 3 ++- catto.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ba12a20..585dba6 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,5 @@ Users can optionally specify whether to fetch a `gif` (animated) or a `still` (j - `!catto` Fetches a random cat image, animated (gif) or still (jpg/png) - `!catto gif` Fetches a random cat animated gif image - `!catto still` Fetches a random cat still jpg/png image - +- `!catto jpg` Fetches a random cat jpg image +- `!catto png` Fetches a random cat png image diff --git a/catto.py b/catto.py index 20c6693..09d2813 100644 --- a/catto.py +++ b/catto.py @@ -43,14 +43,18 @@ class Catto(BotPlugin): @botcmd(split_args_with=' ') def catto(self, msg, args): - """Fetch a random cat image, which may be animated (gif) or still (jpg/png)""" + """Fetch a random cat image, optionally specifying 'gif' (animated), 'still' (jpg or png), or 'jpg' or 'png'""" if len(args) > 0 and args[0]: type = args[0] if type == 'gif': return self.get_catapi_pic("gif") elif type == 'still': return self.get_catapi_pic("jpg,png") + elif type == 'jpg': + return self.get_catapi_pic(type) + elif type == 'png': + return self.get_catapi_pic(type) else: - return 'Unrecognized image type. Please use "gif" or "still" or leave blank to get either type.' + return 'Unrecognized image type. Please use "gif", "still", "jpg", "png", or leave blank to get any type.' else: return self.get_catpic()