aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-05-20 02:08:34 -0400
committerRapptz <[email protected]>2017-05-20 02:08:34 -0400
commitf4e01b3a9289b294ad559263fed0826c111700b2 (patch)
treeb64b3ce601c9f7d1e9be8381e86146686647afce
parentKill remaining references to discord.Channel in documentation. (diff)
downloaddiscord.py-f4e01b3a9289b294ad559263fed0826c111700b2.tar.xz
discord.py-f4e01b3a9289b294ad559263fed0826c111700b2.zip
Make supported operations stand out more than attributes.
-rw-r--r--discord/channel.py72
-rw-r--r--discord/colour.py18
-rw-r--r--discord/emoji.py24
-rw-r--r--discord/game.py18
-rw-r--r--discord/guild.py18
-rw-r--r--discord/invite.py18
-rw-r--r--discord/member.py22
-rw-r--r--discord/reaction.py22
-rw-r--r--discord/role.py34
-rw-r--r--discord/user.py36
-rw-r--r--docs/_static/style.css14
11 files changed, 169 insertions, 127 deletions
diff --git a/discord/channel.py b/discord/channel.py
index bf017545..9a0489bc 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -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
+
+ .. describe:: x == y
- Checks if two channels are equal.
+ Checks if two channels are equal.
- .. describe:: x != y
+ .. describe:: x != y
- Checks if two channels are not equal.
+ Checks if two channels are not equal.
- .. describe:: hash(x)
+ .. describe:: hash(x)
- Returns the channel's hash.
+ Returns the channel's hash.
- .. describe:: str(x)
+ .. describe:: str(x)
- Returns the channel's name.
+ 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
+
+ .. describe:: x == y
- Checks if two channels are equal.
+ Checks if two channels are equal.
- .. describe:: x != y
+ .. describe:: x != y
- Checks if two channels are not equal.
+ Checks if two channels are not equal.
- .. describe:: hash(x)
+ .. describe:: hash(x)
- Returns the channel's hash.
+ Returns the channel's hash.
- .. describe:: str(x)
+ .. describe:: str(x)
- Returns a string representation of the channel
+ Returns a string representation of the channel
Attributes
----------
diff --git a/discord/colour.py b/discord/colour.py
index dd72510a..9644b270 100644
--- a/discord/colour.py
+++ b/discord/colour.py
@@ -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
------------
diff --git a/discord/emoji.py b/discord/emoji.py
index 02df71d6..8c880b5d 100644
--- a/discord/emoji.py
+++ b/discord/emoji.py
@@ -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
-----------
diff --git a/discord/game.py b/discord/game.py
index 6e8ed5cf..121bf4c2 100644
--- a/discord/game.py
+++ b/discord/game.py
@@ -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
-----------
diff --git a/discord/guild.py b/discord/guild.py
index b0b9b02d..1ce331d3 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -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
----------
diff --git a/discord/invite.py b/discord/invite.py
index a630b3fb..3fa860c7 100644
--- a/discord/invite.py
+++ b/discord/invite.py
@@ -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
-----------
diff --git a/discord/member.py b/discord/member.py
index a91f60d1..6c9dc12e 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -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
----------
diff --git a/discord/reaction.py b/discord/reaction.py
index 96862074..833f1b3d 100644
--- a/discord/reaction.py
+++ b/discord/reaction.py
@@ -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
-----------
diff --git a/discord/role.py b/discord/role.py
index d19a5bec..c4ccbf9d 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -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
----------
diff --git a/discord/user.py b/discord/user.py
index e078bc3d..3a30428d 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -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
+
+ .. describe:: x == y
- Checks if two users are equal.
+ Checks if two users are equal.
- .. describe:: x != y
+ .. describe:: x != y
- Checks if two users are not equal.
+ Checks if two users are not equal.
- .. describe:: hash(x)
+ .. describe:: hash(x)
- Return the user's hash.
+ Return the user's hash.
- .. describe:: str(x)
+ .. describe:: str(x)
- Returns the user's name with discriminator.
+ Returns the user's name with discriminator.
Attributes
-----------
diff --git a/docs/_static/style.css b/docs/_static/style.css
index ccbb6af9..8868d2bf 100644
--- a/docs/_static/style.css
+++ b/docs/_static/style.css
@@ -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%;
}