def server_status(self, api_result=None): """Check the current server status.""" result = { 'online': api.get_bool_value(api_result.result, 'serverOpen'), 'players': api.get_int_value(api_result.result, 'onlinePlayers'), } return api.APIResult(result, api_result.timestamp, api_result.expires)
def server_status(self): """Check the current server status.""" api_result = self.api.get('server/ServerStatus') return { 'online': api.get_bool_value(api_result, 'serverOpen'), 'players': api.get_int_value(api_result, 'onlinePlayers'), }