mirror of
https://github.com/boticord/boticordpy.git
synced 2024-09-22 19:32:01 +03:00
fix && formation
This commit is contained in:
parent
f9c8b04428
commit
82a94cac7a
3 changed files with 69 additions and 67 deletions
|
@ -62,7 +62,7 @@ class BoticordClient:
|
|||
Bot's shards count
|
||||
users ( :obj:`int` )
|
||||
Bot's users count
|
||||
|
||||
|
||||
Returns:
|
||||
:obj:`~.types.ResourceBot`:
|
||||
ResourceBot object.
|
||||
|
|
|
@ -213,37 +213,37 @@ class BotLibrary(IntEnum):
|
|||
|
||||
DISCORD4J = 1
|
||||
"""Discord4j"""
|
||||
|
||||
|
||||
DISCORDCR = 2
|
||||
"""Discordcr"""
|
||||
|
||||
|
||||
DISCORDGO = 3
|
||||
"""DiscordGO"""
|
||||
|
||||
|
||||
DISCORDDOO = 4
|
||||
"""Discordoo"""
|
||||
|
||||
|
||||
DSHARPPLUS = 5
|
||||
"""DSharpPlus"""
|
||||
|
||||
|
||||
DISCORDJS = 6
|
||||
"""Discord.js"""
|
||||
|
||||
|
||||
DISCORDNET = 7
|
||||
"""Discord.Net"""
|
||||
|
||||
|
||||
DISCORDPY = 8
|
||||
"""discord.py"""
|
||||
|
||||
|
||||
ERIS = 9
|
||||
"""eris"""
|
||||
|
||||
|
||||
JAVACORD = 10
|
||||
"""JavaCord"""
|
||||
|
||||
|
||||
JDA = 11
|
||||
"""JDA"""
|
||||
|
||||
|
||||
OTHER = 12
|
||||
"""Other"""
|
||||
|
||||
|
@ -409,7 +409,7 @@ class UserLinks(APIObjectBase):
|
|||
self.custon = data.get("custom")
|
||||
|
||||
return self
|
||||
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
class UserBadge(APIObjectBase):
|
||||
|
@ -435,9 +435,9 @@ class UserBadge(APIObjectBase):
|
|||
"""
|
||||
self: UserBadge = super().__new__(cls)
|
||||
|
||||
self.id = data['id']
|
||||
self.name = data['name']
|
||||
self.asset_url = data['assetURL']
|
||||
self.id = data["id"]
|
||||
self.name = data["name"]
|
||||
self.asset_url = data["assetURL"]
|
||||
|
||||
return self
|
||||
|
||||
|
@ -554,11 +554,6 @@ class PartialUser(APIObjectBase):
|
|||
self.short_domain = data.get("shortDomain")
|
||||
|
||||
return self
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
class ResourceBot(APIObjectBase):
|
||||
"""Tak nado"""
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
|
@ -639,24 +634,24 @@ class ResourceServer(APIObjectBase):
|
|||
----------
|
||||
data: :class:`dict`
|
||||
The dictionary to convert into a ResourceServer."""
|
||||
|
||||
|
||||
self = super().__new__(cls)
|
||||
|
||||
self.id = data['id']
|
||||
self.name = data['name']
|
||||
self.short_description = data['shortDescription']
|
||||
self.description = data['description)']
|
||||
self.id = data["id"]
|
||||
self.name = data["name"]
|
||||
self.short_description = data["shortDescription"]
|
||||
self.description = data["description)"]
|
||||
self.avatar = data.get("avatar")
|
||||
self.short_link = data.get("shortLink")
|
||||
self.invite_link = data.get("inviteLink")
|
||||
self.owner = data.get("owner")
|
||||
self.website = data.get("website")
|
||||
self.up_count = data.get("upCount")
|
||||
|
||||
self.premium_active = data['premium'].get('active')
|
||||
self.premium_splash_url = data['premium'].get('splashURL')
|
||||
self.premium_auto_fetch = data['premium'].get('autoFetch')
|
||||
self.premium_banner_url = data['premium'].get('bannerURL')
|
||||
|
||||
self.premium_active = data["premium"].get("active")
|
||||
self.premium_splash_url = data["premium"].get("splashURL")
|
||||
self.premium_auto_fetch = data["premium"].get("autoFetch")
|
||||
self.premium_banner_url = data["premium"].get("bannerURL")
|
||||
|
||||
self.status = ResourceStatus(data.get("status"))
|
||||
self.ratings = [
|
||||
|
@ -676,46 +671,14 @@ class ResourceServer(APIObjectBase):
|
|||
return self
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
class UserProfile(PartialUser):
|
||||
"""Information about user's profile from BotiCord.
|
||||
|
||||
It has all from PartialUser and some more params: 'bots', 'servers', 'badges'"""
|
||||
|
||||
badges: List[UserBadge]
|
||||
"""User's badges list."""
|
||||
|
||||
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.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
data: :class:`dict`
|
||||
The dictionary to convert into a UserProfile."""
|
||||
|
||||
self = super().from_dict(data)
|
||||
|
||||
self.badges = [UserBadge.from_dict(badge) for badge in data.get('badges', [])]
|
||||
self.bots = [ResourceBot.from_dict(bot) for bot in data.get('bots', [])]
|
||||
self.servers = [ResourceServer.from_dict(server) for server in data.get('servers', [])]
|
||||
|
||||
return self
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
class ResourceBot(APIObjectBase):
|
||||
"""Bot published on BotiCord
|
||||
|
||||
.. warning::
|
||||
|
||||
The result of the reverse conversion (`.to_dict()`) may not match the actual data."""
|
||||
The result of the reverse conversion (`.to_dict()`) may not match the actual data.
|
||||
"""
|
||||
|
||||
id: str
|
||||
"""ID of the bot"""
|
||||
|
@ -852,5 +815,40 @@ class ResourceBot(APIObjectBase):
|
|||
return self
|
||||
|
||||
|
||||
@dataclass(repr=False)
|
||||
class UserProfile(PartialUser):
|
||||
"""Information about user's profile from BotiCord.
|
||||
|
||||
It has all from PartialUser and some more params: 'bots', 'servers', 'badges'"""
|
||||
|
||||
badges: List[UserBadge]
|
||||
"""User's badges list."""
|
||||
|
||||
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.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
data: :class:`dict`
|
||||
The dictionary to convert into a UserProfile."""
|
||||
|
||||
self = super().from_dict(data)
|
||||
|
||||
self.badges = [UserBadge.from_dict(badge) for badge in data.get("badges", [])]
|
||||
self.bots = [ResourceBot.from_dict(bot) for bot in data.get("bots", [])]
|
||||
self.servers = [
|
||||
ResourceServer.from_dict(server) for server in data.get("servers", [])
|
||||
]
|
||||
|
||||
return self
|
||||
|
||||
|
||||
class LinkDomain:
|
||||
pass
|
||||
|
|
|
@ -42,10 +42,14 @@ extensions = [
|
|||
"sphinx.ext.viewcode",
|
||||
"sphinx.ext.autosectionlabel",
|
||||
"sphinx.ext.extlinks",
|
||||
"sphinxcontrib_trio"
|
||||
"sphinxcontrib_trio",
|
||||
]
|
||||
|
||||
autodoc_default_options = {"members": True, "show-inheritance": True, 'member-order': 'bysource'}
|
||||
autodoc_default_options = {
|
||||
"members": True,
|
||||
"show-inheritance": True,
|
||||
"member-order": "bysource",
|
||||
}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ["_templates"]
|
||||
|
|
Loading…
Reference in a new issue