From fba193890aedec3fa03a3025fb6c4310c94dc8fa Mon Sep 17 00:00:00 2001 From: grey-cat-1908 Date: Thu, 7 Apr 2022 22:41:46 +0300 Subject: [PATCH] update returns docstrings --- melisa/models/guild/channel.py | 12 +++++++----- melisa/models/message/message.py | 14 +++++++------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/melisa/models/guild/channel.py b/melisa/models/guild/channel.py index 6985026..9b380e4 100644 --- a/melisa/models/guild/channel.py +++ b/melisa/models/guild/channel.py @@ -300,8 +300,8 @@ class MessageableChannel(Channel): Returns ------- - Union[:class:`~melisa.models.guild.channel.PublicThread`, - :class:`~melisa.models.guild.channel.PrivateThread`] + Union[:class:`~melisa.models.guild.channel.Channel`, + :class:`Any`] The created thread. """ @@ -335,6 +335,8 @@ class MessageableChannel(Channel): --------- Flattening messages into a list: .. code-block:: python + :linenos: + messages = [message async for message in channel.history(limit=111)] All parameters are optional. @@ -359,7 +361,7 @@ class MessageableChannel(Channel): Returns ------- - AsyncIterator[:class:`~melisa.Message`] + AsyncIterator[:class:`~melisa.models.message.message.Message`] An iterator of messages. """ @@ -412,7 +414,7 @@ class MessageableChannel(Channel): Returns ------- - :class:`~melisa.Message` + :class:`~melisa.models.message.message.Message` Message object. """ @@ -434,7 +436,7 @@ class MessageableChannel(Channel): Returns ------- - AsyncIterator[:class:`~melisa.Message`] + AsyncIterator[:class:`~melisa.models.message.message.Message`] AsyncIterator of Message objects. """ diff --git a/melisa/models/message/message.py b/melisa/models/message/message.py index ba2d2b6..eb88b90 100644 --- a/melisa/models/message/message.py +++ b/melisa/models/message/message.py @@ -106,11 +106,11 @@ class Message(APIModelBase): Attributes ---------- - id: :class:`~melisa.utils.types.Snowflake` + id: :class:`~melisa.utils.types.snowflake.Snowflake` Id of the message - channel_id: :class:`~melisa.utils.types.Snowflake` + channel_id: :class:`~melisa.utils.types.snowflake.Snowflake` Id of the channel the message was sent in - guild_id: :class:`~melisa.utils.types.Snowflake` + guild_id: :class:`~melisa.utils.types.snowflake.Snowflake` Id of the guild the message was sent in author: :class:`typing.Any` The author of this message (not guaranteed to be a valid user, see below) @@ -118,9 +118,9 @@ class Message(APIModelBase): Member properties for this message's author content: :class:`str` Contents of the message - timestamp: :class:`~melisa.utils.Timestamp` + timestamp: :class:`~melisa.utils.timestamp.Timestamp` When this message was sent - edited_timestamp: :class:`~melisa.utils.Timestamp` + edited_timestamp: :class:`~melisa.utils.timestamp.Timestamp` When this message was edited (or null if never) tts: :class:`bool` Whether this was a TTS message @@ -142,7 +142,7 @@ class Message(APIModelBase): Used for validating a message was sent pinned: :class:`bool` Whether this message is pinned - webhook_id: :class:`~melisa.utils.types.Snowflake` + webhook_id: :class:`~melisa.utils.types.snowflake.Snowflake` If the message is generated by a webhook, this is the webhook's id type: :class:`int` Type of message @@ -150,7 +150,7 @@ class Message(APIModelBase): Sent with Rich Presence-related chat embeds application: :class:`typing.Any` Sent with Rich Presence-related chat embeds - application_id: :class:`~melisa.Snowflake` + application_id: :class:`~melisa.utils.types.snowflake.Snowflake` If the message is an Interaction or application-owned webhook, this is the id of the application message_reference: :class:`typing.Any`