Code cleanup involving enums and message replies

This commit is contained in:
Rapptz
2020-11-27 00:32:08 -05:00
parent d1cb30cccf
commit bd6ab93348
4 changed files with 80 additions and 101 deletions

View File

@@ -446,6 +446,11 @@ class ExpireBehaviour(Enum):
ExpireBehavior = ExpireBehaviour
class StickerType(Enum):
png = 1
apng = 2
lottie = 3
def try_enum(cls, val):
"""A function that tries to turn the value into enum ``cls``.
@@ -456,8 +461,3 @@ def try_enum(cls, val):
return cls._enum_value_map_[val]
except (KeyError, TypeError, AttributeError):
return val
class StickerType(Enum):
png = 1
apng = 2
lottie = 3