Handle CHANNEL_UPDATE for group direct messages.

This commit is contained in:
Rapptz committed 2016-07-13 17:23:35 -04:00
1 parent ddd3fd0a3d
commit 69c506d7ae
3 files changed
+27 -15

No files matched your search

+10
View File
@@ -73,3 +73,13 @@ class DefaultAvatar(Enum):
def __str__(self):
return self.name
def try_enum(cls, val):
"""A function that tries to turn the value into enum ``cls``.
If it fails it returns the value instead.
"""
try:
return cls(val)
except ValueError:
return val