Handle CHANNEL_UPDATE for group direct messages.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user