mirror of
https://github.com/yawaflua/Py-SPW.git
synced 2026-02-04 10:24:13 +02:00
Upload 1.5.0 version
Upload docs
This commit is contained in:
@@ -1,34 +1,53 @@
|
||||
class Error(Exception):
|
||||
class _Error(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class WebserverError(Error):
|
||||
class _ApiError(_Error):
|
||||
pass
|
||||
|
||||
|
||||
class NotFunction(WebserverError):
|
||||
class SpwApiError(_ApiError):
|
||||
pass
|
||||
|
||||
|
||||
class ApiError(Error):
|
||||
class SpwApiDDOS(SpwApiError):
|
||||
def __init__(self):
|
||||
super().__init__("SPWorlds DDOS protection block your request")
|
||||
|
||||
|
||||
class SpwUserNotFound(SpwApiError):
|
||||
def __init__(self, discord_id: str):
|
||||
self._discord_id = discord_id
|
||||
super().__init__(f"User with discord id `{discord_id}` not found in spworlds")
|
||||
|
||||
@property
|
||||
def discord_id(self) -> str:
|
||||
return self._discord_id
|
||||
|
||||
|
||||
class SpwUnauthorized(SpwApiError):
|
||||
def __init__(self):
|
||||
super().__init__("Access details are invalid")
|
||||
|
||||
|
||||
class SpwInsufficientFunds(SpwApiError):
|
||||
def __init__(self):
|
||||
super().__init__("Insufficient funds on the card")
|
||||
|
||||
|
||||
class MojangApiError(_ApiError):
|
||||
pass
|
||||
|
||||
|
||||
class SpwApiError(ApiError):
|
||||
pass
|
||||
|
||||
|
||||
class BadParameter(SpwApiError):
|
||||
pass
|
||||
|
||||
|
||||
class MojangApiError(ApiError):
|
||||
pass
|
||||
|
||||
|
||||
class SurgeplayApiError(ApiError):
|
||||
pass
|
||||
|
||||
|
||||
class BadSkinPartName(SurgeplayApiError):
|
||||
class MojangAccountNotFound(MojangApiError):
|
||||
def __init__(self, nickname: str):
|
||||
self._nickname = nickname
|
||||
super().__init__(f"Account with name `{nickname}` not found")
|
||||
|
||||
@property
|
||||
def nickname(self) -> str:
|
||||
return self._nickname
|
||||
|
||||
|
||||
class SurgeplayApiError(_ApiError):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user