diff --git a/docs/api.rst b/docs/api.rst index 09c0ba6..81870f8 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -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 diff --git a/docs/conf.py b/docs/conf.py index 55ade24..65377fc 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 ------------------------------------------------- diff --git a/docs_requirements.txt b/docs_requirements.txt index df493e2..7d8a4e5 100644 --- a/docs_requirements.txt +++ b/docs_requirements.txt @@ -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 diff --git a/revolt/__init__.py b/revolt/__init__.py index bccc4bf..d6be959 100644 --- a/revolt/__init__.py +++ b/revolt/__init__.py @@ -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) diff --git a/revolt/user.py b/revolt/user.py index fd6aec4..3035247 100644 --- a/revolt/user.py +++ b/revolt/user.py @@ -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]