updated to allow specifying jpg or png; clarified instructions
This commit is contained in:
parent
70a58519c8
commit
5fbdef2b24
2 changed files with 8 additions and 3 deletions
|
@ -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` Fetches a random cat image, animated (gif) or still (jpg/png)
|
||||||
- `!catto gif` Fetches a random cat animated gif image
|
- `!catto gif` Fetches a random cat animated gif image
|
||||||
- `!catto still` Fetches a random cat still jpg/png 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
|
||||||
|
|
8
catto.py
8
catto.py
|
@ -43,14 +43,18 @@ class Catto(BotPlugin):
|
||||||
|
|
||||||
@botcmd(split_args_with=' ')
|
@botcmd(split_args_with=' ')
|
||||||
def catto(self, msg, args):
|
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]:
|
if len(args) > 0 and args[0]:
|
||||||
type = args[0]
|
type = args[0]
|
||||||
if type == 'gif':
|
if type == 'gif':
|
||||||
return self.get_catapi_pic("gif")
|
return self.get_catapi_pic("gif")
|
||||||
elif type == 'still':
|
elif type == 'still':
|
||||||
return self.get_catapi_pic("jpg,png")
|
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:
|
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:
|
else:
|
||||||
return self.get_catpic()
|
return self.get_catpic()
|
||||||
|
|
Loading…
Reference in a new issue