예제 #1
0
파일: player.py 프로젝트: Eros/Hython
    def __init__(self, uuid):
        """
        called when a request is made to seach for a player by UUID
        :param uuid:
        """
        self.uuid = uuid

        if len(uuid) <= 16:
            self.JSON = h.get_json_data('player', uuid=uuid)
            JSON = self.JSON
            self.uuid = self.JSON['uuid']
        elif len(uuid) == 32 or len(uuid) == 36:
            self.JSON = h.get_json_data('player', uuid=uuid)
        else:
            raise e.PlayerNotFoundException
예제 #2
0
 def __init__(self, guid):
     """
     Basic guild setup, requires the guild ID
     :param guid:
     """
     try:
         if len(guid) == 24:
             self.guid = guid
             self.JSON = h.get_json_data('guild', guid)
     except e.HypixelAPIException:
         pass