mirror of
https://github.com/boticord/boticordpy.git
synced 2024-11-11 19:07:29 +03:00
commit
f9c8b04428
3 changed files with 17 additions and 1 deletions
|
@ -42,7 +42,7 @@ class HttpClient:
|
||||||
async with self.session.request(method, url, **kwargs) as response:
|
async with self.session.request(method, url, **kwargs) as response:
|
||||||
data = await response.json()
|
data = await response.json()
|
||||||
|
|
||||||
if response.status == 200 or response.status == 201:
|
if (200, 201).__contains__(response.status):
|
||||||
return data["result"]
|
return data["result"]
|
||||||
else:
|
else:
|
||||||
raise exceptions.HTTPException(
|
raise exceptions.HTTPException(
|
||||||
|
|
|
@ -688,6 +688,9 @@ class UserProfile(PartialUser):
|
||||||
bots: List[ResourceBot]
|
bots: List[ResourceBot]
|
||||||
"""User's bots list"""
|
"""User's bots list"""
|
||||||
|
|
||||||
|
servers: List[ResourceServer]
|
||||||
|
"""User's servers list"""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, data: dict):
|
def from_dict(cls, data: dict):
|
||||||
"""Generate a UserProfile from the given data.
|
"""Generate a UserProfile from the given data.
|
||||||
|
|
|
@ -19,6 +19,9 @@ Enums
|
||||||
.. autoclass:: BotTag
|
.. autoclass:: BotTag
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: ServerTag
|
||||||
|
:members:
|
||||||
|
|
||||||
.. autoclass:: ResourceStatus
|
.. autoclass:: ResourceStatus
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
@ -30,6 +33,13 @@ Bots
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
|
||||||
|
Servers
|
||||||
|
---------
|
||||||
|
|
||||||
|
.. autoclass:: ResourceServer
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
Users
|
Users
|
||||||
------
|
------
|
||||||
|
|
||||||
|
@ -38,3 +48,6 @@ Users
|
||||||
|
|
||||||
.. autoclass:: PartialUser
|
.. autoclass:: PartialUser
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
|
.. autoclass:: UserProfile
|
||||||
|
:members:
|
||||||
|
|
Loading…
Reference in a new issue