@classmethod
def from_json(cls, server, json):
    """Creates a new channel object from the JSON returned by the Decent API."""
    cid = json['id']
    name = json['name']
    unread_count = json.get('unreadMessageCount')
    if unread_count:
        unread_count = int(unread_count)
    return cls(server, cid, name, unread_count)
