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:
|
||||
data = await response.json()
|
||||
|
||||
if response.status == 200 or response.status == 201:
|
||||
if (200, 201).__contains__(response.status):
|
||||
return data["result"]
|
||||
else:
|
||||
raise exceptions.HTTPException(
|
||||
|
|
|
@ -688,6 +688,9 @@ class UserProfile(PartialUser):
|
|||
bots: List[ResourceBot]
|
||||
"""User's bots list"""
|
||||
|
||||
servers: List[ResourceServer]
|
||||
"""User's servers list"""
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: dict):
|
||||
"""Generate a UserProfile from the given data.
|
||||
|
|
|
@ -19,6 +19,9 @@ Enums
|
|||
.. autoclass:: BotTag
|
||||
:members:
|
||||
|
||||
.. autoclass:: ServerTag
|
||||
:members:
|
||||
|
||||
.. autoclass:: ResourceStatus
|
||||
:members:
|
||||
|
||||
|
@ -30,6 +33,13 @@ Bots
|
|||
:members:
|
||||
|
||||
|
||||
Servers
|
||||
---------
|
||||
|
||||
.. autoclass:: ResourceServer
|
||||
:members:
|
||||
|
||||
|
||||
Users
|
||||
------
|
||||
|
||||
|
@ -38,3 +48,6 @@ Users
|
|||
|
||||
.. autoclass:: PartialUser
|
||||
:members:
|
||||
|
||||
.. autoclass:: UserProfile
|
||||
:members:
|
||||
|
|
Loading…
Reference in a new issue