mirror of
https://github.com/stoatchat/python-client-sdk.git
synced 2026-07-21 01:55:23 -04:00
make namedtuples documented
This commit is contained in:
+17
-5
@@ -35,26 +35,26 @@ DMChannel
|
||||
:members:
|
||||
|
||||
GroupDMChannel
|
||||
~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
.. autoclass:: GroupDMChannel
|
||||
:members:
|
||||
|
||||
TextChannel
|
||||
~~~~~~~~~~
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. autoclass:: TextChannel
|
||||
:members:
|
||||
|
||||
VoiceChannel
|
||||
~~~~~~~~~~
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. autoclass:: VoiceChannel
|
||||
:members:
|
||||
|
||||
|
||||
Embed
|
||||
~~~~~~~~~~
|
||||
~~~~~~
|
||||
|
||||
.. autoclass:: Embed
|
||||
:members:
|
||||
@@ -108,8 +108,20 @@ User
|
||||
.. autoclass:: User
|
||||
:members:
|
||||
|
||||
Relation
|
||||
~~~~~~~~~
|
||||
|
||||
.. autonamedtuple:: Relation
|
||||
|
||||
|
||||
Status
|
||||
~~~~~~~
|
||||
|
||||
.. autonamedtuple:: Status
|
||||
|
||||
|
||||
Enums
|
||||
------
|
||||
======
|
||||
|
||||
The api uses enums to say what variant of something is, these represent those enums
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@ version = "0.0.1"
|
||||
extensions = [
|
||||
"sphinx.ext.napoleon",
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx_toolbox.installation",
|
||||
"sphinx_toolbox.more_autodoc.autonamedtuple"
|
||||
]
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
@@ -42,6 +44,7 @@ templates_path = ['_templates']
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
|
||||
|
||||
add_module_names = False
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
Sphinx==4.1.2
|
||||
Sphinx==3.5.4
|
||||
sphinx-nameko-theme==0.0.3
|
||||
aiohttp==3.7.4.post0
|
||||
ulid-py==1.1.0
|
||||
sphinx-toolbox==2.13.0
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
from .asset import Asset
|
||||
from .channel import DMChannel, Channel, GroupDMChannel, SavedMessageChannel, VoiceChannel
|
||||
from .channel import DMChannel, Channel, GroupDMChannel, SavedMessageChannel, VoiceChannel, TextChannel
|
||||
from .client import Client
|
||||
from .embed import Embed
|
||||
from .errors import HTTPError, RevoltError, ServerError
|
||||
@@ -10,6 +10,6 @@ from .messageable import Messageable
|
||||
from .permissions import Permissions
|
||||
from .role import Role
|
||||
from .server import Server
|
||||
from .user import User
|
||||
from .user import User, Status, Relation
|
||||
|
||||
__version__ = (0, 0, 1)
|
||||
|
||||
+2
-9
@@ -10,19 +10,12 @@ if TYPE_CHECKING:
|
||||
from .types import User as UserPayload, UserRelation
|
||||
|
||||
class Relation(NamedTuple):
|
||||
"""A namedtuple representing a relation between the bot and a user
|
||||
|
||||
Attributes
|
||||
-----------
|
||||
type: :class:`RelationshipType`
|
||||
The type of relationship
|
||||
user: :class:`User`
|
||||
The user the relationship is for
|
||||
"""
|
||||
"""A namedtuple representing a relation between the bot and a user"""
|
||||
type: RelationshipType
|
||||
user: User
|
||||
|
||||
class Status(NamedTuple):
|
||||
"""A namedtuple representing a users status"""
|
||||
text: Optional[str]
|
||||
presence: Optional[PresenceType]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user