1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00
EmoteManager/utils/converter.py
2019-10-15 21:59:34 +00:00

11 lines
398 B
Python

_emote_type_predicates = {
'': lambda _: True, # allow usage as a "consume rest" converter
'all': lambda _: True,
'static': lambda e: not e.animated,
'animated': lambda e: e.animated}
def emote_type_filter(argument):
try:
return _emote_type_predicates[argument.lower()]
except KeyError:
raise commands.BadArgument('Invalid emote type. Specify “static”, “animated”, “all”.')