Make supported operations stand out more than attributes.

This commit is contained in:
Rapptz 2017-05-20 02:08:34 -04:00
parent 3727618b65
commit f4e01b3a92
11 changed files with 169 additions and 127 deletions

View File

@ -44,21 +44,23 @@ def _single_delete_strategy(messages, *, reason):
class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
"""Represents a Discord guild text channel.
.. describe:: x == y
.. container:: operations
Checks if two channels are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two channels are equal.
Checks if two channels are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two channels are not equal.
Returns the channel's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the channel's hash.
Returns the channel's name.
.. describe:: str(x)
Returns the channel's name.
Attributes
-----------
@ -302,21 +304,23 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
class VoiceChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable):
"""Represents a Discord guild voice channel.
.. describe:: x == y
.. container:: operations
Checks if two channels are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two channels are equal.
Checks if two channels are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two channels are not equal.
Returns the channel's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the channel's hash.
Returns the channel's name.
.. describe:: str(x)
Returns the channel's name.
Attributes
-----------
@ -414,21 +418,23 @@ class VoiceChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable):
class DMChannel(discord.abc.Messageable, Hashable):
"""Represents a Discord direct message channel.
.. describe:: x == y
.. container:: operations
Checks if two channels are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two channels are equal.
Checks if two channels are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two channels are not equal.
Returns the channel's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the channel's hash.
Returns a string representation of the channel
.. describe:: str(x)
Returns a string representation of the channel
Attributes
----------
@ -495,21 +501,23 @@ class DMChannel(discord.abc.Messageable, Hashable):
class GroupChannel(discord.abc.Messageable, Hashable):
"""Represents a Discord group channel.
.. describe:: x == y
.. container:: operations
Checks if two channels are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two channels are equal.
Checks if two channels are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two channels are not equal.
Returns the channel's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the channel's hash.
Returns a string representation of the channel
.. describe:: str(x)
Returns a string representation of the channel
Attributes
----------

View File

@ -30,21 +30,23 @@ class Colour:
There is an alias for this called Color.
.. describe:: x == y
.. container:: operations
Checks if two colours are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two colours are equal.
Checks if two colours are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two colours are not equal.
Return the colour's hash.
.. describe:: hash(x)
.. describe:: str(x)
Return the colour's hash.
Returns the hex format for the colour.
.. describe:: str(x)
Returns the hex format for the colour.
Attributes
------------

View File

@ -38,26 +38,28 @@ class Emoji(Hashable):
Depending on the way this object was created, some of the attributes can
have a value of ``None``.
.. describe:: x == y
.. container:: operations
Checks if two emoji are the same.
.. describe:: x == y
.. describe:: x != y
Checks if two emoji are the same.
Checks if two emoji are not the same.
.. describe:: x != y
.. describe:: hash(x)
Checks if two emoji are not the same.
Return the emoji's hash.
.. describe:: hash(x)
.. describe:: iter(x)
Return the emoji's hash.
Returns an iterator of ``(field, value)`` pairs. This allows this class
to be used as an iterable in list/dict/etc constructions.
.. describe:: iter(x)
.. describe:: str(x)
Returns an iterator of ``(field, value)`` pairs. This allows this class
to be used as an iterable in list/dict/etc constructions.
Returns the emoji rendered for discord.
.. describe:: str(x)
Returns the emoji rendered for discord.
Attributes
-----------

View File

@ -27,21 +27,23 @@ DEALINGS IN THE SOFTWARE.
class Game:
"""Represents a Discord game.
.. describe:: x == y
.. container:: operations
Checks if two games are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two games are equal.
Checks if two games are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two games are not equal.
Returns the game's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the game's hash.
Returns the game's name.
.. describe:: str(x)
Returns the game's name.
Attributes
-----------

View File

@ -50,21 +50,23 @@ class Guild(Hashable):
This is referred to as a "server" in the official Discord UI.
.. describe:: x == y
.. container:: operations
Checks if two guilds are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two guilds are equal.
Checks if two guilds are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two guilds are not equal.
Returns the guild's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the guild's hash.
Returns the guild's name.
.. describe:: str(x)
Returns the guild's name.
Attributes
----------

View File

@ -36,21 +36,23 @@ class Invite(Hashable):
Depending on the way this object was created, some of the attributes can
have a value of ``None``.
.. describe:: x == y
.. container:: operations
Checks if two invites are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two invites are equal.
Checks if two invites are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two invites are not equal.
Returns the invite hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the invite hash.
Returns the invite URL.
.. describe:: str(x)
Returns the invite URL.
Attributes
-----------

View File

@ -114,23 +114,25 @@ class Member(discord.abc.Messageable, _BaseUser):
This implements a lot of the functionality of :class:`User`.
.. describe:: x == y
.. container:: operations
Checks if two members are equal.
Note that this works with :class:`User` instances too.
.. describe:: x == y
.. describe:: x != y
Checks if two members are equal.
Note that this works with :class:`User` instances too.
Checks if two members are not equal.
Note that this works with :class:`User` instances too.
.. describe:: x != y
.. describe:: hash(x)
Checks if two members are not equal.
Note that this works with :class:`User` instances too.
Returns the member's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the member's hash.
Returns the member's name with the discriminator.
.. describe:: str(x)
Returns the member's name with the discriminator.
Attributes
----------

View File

@ -32,23 +32,25 @@ class Reaction:
Depending on the way this object was created, some of the attributes can
have a value of ``None``.
.. describe:: x == y
.. container:: operations
Checks if two reactions are equal. This works by checking if the emoji
is the same. So two messages with the same reaction will be considered
"equal".
.. describe:: x == y
.. describe:: x != y
Checks if two reactions are equal. This works by checking if the emoji
is the same. So two messages with the same reaction will be considered
"equal".
Checks if two reactions are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two reactions are not equal.
Returns the reaction's hash.
.. describe:: hash(x)
.. describe:: str(x)
Returns the reaction's hash.
Returns the channel's name.
.. describe:: str(x)
Returns the channel's name.
Attributes
-----------

View File

@ -35,37 +35,39 @@ from .utils import snowflake_time
class Role(Hashable):
"""Represents a Discord role in a :class:`Guild`.
.. describe:: x == y
.. container:: operations
Checks if two roles are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two roles are equal.
Checks if two roles are not equal.
.. describe:: x != y
.. describe:: x > y
Checks if two roles are not equal.
Checks if a role is higher than another in the hierarchy.
.. describe:: x > y
.. describe:: x < y
Checks if a role is higher than another in the hierarchy.
Checks if a role is lower than another in the hierarchy.
.. describe:: x < y
.. describe:: x >= y
Checks if a role is lower than another in the hierarchy.
Checks if a role is higher or equal to another in the hierarchy.
.. describe:: x >= y
.. describe:: x <= y
Checks if a role is higher or equal to another in the hierarchy.
Checks if a role is lower or equal to another in the hierarchy.
.. describe:: x <= y
.. describe:: hash(x)
Checks if a role is lower or equal to another in the hierarchy.
Return the role's hash.
.. describe:: hash(x)
.. describe:: str(x)
Return the role's hash.
Returns the role's name.
.. describe:: str(x)
Returns the role's name.
Attributes
----------

View File

@ -177,21 +177,23 @@ class BaseUser(_BaseUser):
class ClientUser(BaseUser):
"""Represents your Discord user.
.. describe:: x == y
.. container:: operations
Checks if two users are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two users are equal.
Checks if two users are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two users are not equal.
Return the user's hash.
.. describe:: hash(x)
.. describe:: str(x)
Return the user's hash.
Returns the user's name with discriminator.
.. describe:: str(x)
Returns the user's name with discriminator.
Attributes
-----------
@ -386,21 +388,23 @@ class ClientUser(BaseUser):
class User(BaseUser, discord.abc.Messageable):
"""Represents a Discord user.
.. describe:: x == y
.. container:: operations
Checks if two users are equal.
.. describe:: x == y
.. describe:: x != y
Checks if two users are equal.
Checks if two users are not equal.
.. describe:: x != y
.. describe:: hash(x)
Checks if two users are not equal.
Return the user's hash.
.. describe:: hash(x)
.. describe:: str(x)
Return the user's hash.
Returns the user's name with discriminator.
.. describe:: str(x)
Returns the user's name with discriminator.
Attributes
-----------

View File

@ -351,6 +351,20 @@ dl.exception > dt {
padding: 1px 10px;
}
.container.operations {
background-color: #fcfcfc;
padding: 10px;
}
.container.operations::before {
content: 'Supported Operations';
font-weight: bold;
}
.container.operations > dl.describe > dt {
background-color: transparent;
}
table.docutils {
width: 100%;
}