aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/channel.py108
-rw-r--r--discord/emoji.py38
-rw-r--r--discord/game.py28
-rw-r--r--discord/guild.py28
-rw-r--r--discord/invite.py28
-rw-r--r--discord/member.py30
-rw-r--r--discord/reaction.py30
-rw-r--r--discord/role.py52
-rw-r--r--discord/user.py56
9 files changed, 218 insertions, 180 deletions
diff --git a/discord/channel.py b/discord/channel.py
index 4391b847..bf017545 100644
--- a/discord/channel.py
+++ b/discord/channel.py
@@ -44,19 +44,21 @@ def _single_delete_strategy(messages, *, reason):
class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
"""Represents a Discord guild text channel.
- Supported Operations:
-
- +-----------+---------------------------------------+
- | Operation | Description |
- +===========+=======================================+
- | x == y | Checks if two channels are equal. |
- +-----------+---------------------------------------+
- | x != y | Checks if two channels are not equal. |
- +-----------+---------------------------------------+
- | hash(x) | Returns the channel's hash. |
- +-----------+---------------------------------------+
- | str(x) | Returns the channel's name. |
- +-----------+---------------------------------------+
+ .. describe:: x == y
+
+ Checks if two channels are equal.
+
+ .. describe:: x != y
+
+ Checks if two channels are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the channel's hash.
+
+ .. describe:: str(x)
+
+ Returns the channel's name.
Attributes
-----------
@@ -300,19 +302,21 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
class VoiceChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable):
"""Represents a Discord guild voice channel.
- Supported Operations:
+ .. describe:: x == y
+
+ Checks if two channels are equal.
+
+ .. describe:: x != y
+
+ Checks if two channels are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the channel's hash.
+
+ .. describe:: str(x)
- +-----------+---------------------------------------+
- | Operation | Description |
- +===========+=======================================+
- | x == y | Checks if two channels are equal. |
- +-----------+---------------------------------------+
- | x != y | Checks if two channels are not equal. |
- +-----------+---------------------------------------+
- | hash(x) | Returns the channel's hash. |
- +-----------+---------------------------------------+
- | str(x) | Returns the channel's name. |
- +-----------+---------------------------------------+
+ Returns the channel's name.
Attributes
-----------
@@ -410,19 +414,21 @@ class VoiceChannel(discord.abc.Connectable, discord.abc.GuildChannel, Hashable):
class DMChannel(discord.abc.Messageable, Hashable):
"""Represents a Discord direct message channel.
- Supported Operations:
+ .. describe:: x == y
- +-----------+-------------------------------------------------+
- | Operation | Description |
- +===========+=================================================+
- | x == y | Checks if two channels are equal. |
- +-----------+-------------------------------------------------+
- | x != y | Checks if two channels are not equal. |
- +-----------+-------------------------------------------------+
- | hash(x) | Returns the channel's hash. |
- +-----------+-------------------------------------------------+
- | str(x) | Returns a string representation of the channel |
- +-----------+-------------------------------------------------+
+ Checks if two channels are equal.
+
+ .. describe:: x != y
+
+ Checks if two channels are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the channel's hash.
+
+ .. describe:: str(x)
+
+ Returns a string representation of the channel
Attributes
----------
@@ -489,19 +495,21 @@ class DMChannel(discord.abc.Messageable, Hashable):
class GroupChannel(discord.abc.Messageable, Hashable):
"""Represents a Discord group channel.
- Supported Operations:
-
- +-----------+-------------------------------------------------+
- | Operation | Description |
- +===========+=================================================+
- | x == y | Checks if two channels are equal. |
- +-----------+-------------------------------------------------+
- | x != y | Checks if two channels are not equal. |
- +-----------+-------------------------------------------------+
- | hash(x) | Returns the channel's hash. |
- +-----------+-------------------------------------------------+
- | str(x) | Returns a string representation of the channel |
- +-----------+-------------------------------------------------+
+ .. describe:: x == y
+
+ Checks if two channels are equal.
+
+ .. describe:: x != y
+
+ Checks if two channels are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the channel's hash.
+
+ .. describe:: str(x)
+
+ Returns a string representation of the channel
Attributes
----------
diff --git a/discord/emoji.py b/discord/emoji.py
index 3c61b137..02df71d6 100644
--- a/discord/emoji.py
+++ b/discord/emoji.py
@@ -38,24 +38,26 @@ class Emoji(Hashable):
Depending on the way this object was created, some of the attributes can
have a value of ``None``.
- Supported Operations:
-
- +-----------+-----------------------------------------+
- | Operation | Description |
- +===========+=========================================+
- | x == y | Checks if two emoji are the same. |
- +-----------+-----------------------------------------+
- | x != y | Checks if two emoji are not the same. |
- +-----------+-----------------------------------------+
- | hash(x) | Return the emoji's hash. |
- +-----------+-----------------------------------------+
- | iter(x) | Returns an iterator of (field, value) |
- | | pairs. This allows this class to be |
- | | used as an iterable in list/dict/etc. |
- | | constructions. |
- +-----------+-----------------------------------------+
- | str(x) | Returns the emoji rendered for discord. |
- +-----------+-----------------------------------------+
+ .. describe:: x == y
+
+ Checks if two emoji are the same.
+
+ .. describe:: x != y
+
+ Checks if two emoji are not the same.
+
+ .. describe:: hash(x)
+
+ Return the emoji's hash.
+
+ .. describe:: iter(x)
+
+ Returns an iterator of ``(field, value)`` pairs. This allows this class
+ to be used as an iterable in list/dict/etc constructions.
+
+ .. describe:: str(x)
+
+ Returns the emoji rendered for discord.
Attributes
-----------
diff --git a/discord/game.py b/discord/game.py
index 2cb3587a..6e8ed5cf 100644
--- a/discord/game.py
+++ b/discord/game.py
@@ -27,19 +27,21 @@ DEALINGS IN THE SOFTWARE.
class Game:
"""Represents a Discord game.
- Supported Operations:
-
- +-----------+------------------------------------+
- | Operation | Description |
- +===========+====================================+
- | x == y | Checks if two games are equal. |
- +-----------+------------------------------------+
- | x != y | Checks if two games are not equal. |
- +-----------+------------------------------------+
- | hash(x) | Return the games's hash. |
- +-----------+------------------------------------+
- | str(x) | Returns the games's name. |
- +-----------+------------------------------------+
+ .. describe:: x == y
+
+ Checks if two games are equal.
+
+ .. describe:: x != y
+
+ Checks if two games are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the game's hash.
+
+ .. describe:: str(x)
+
+ Returns the game's name.
Attributes
-----------
diff --git a/discord/guild.py b/discord/guild.py
index 4987ea36..b0b9b02d 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -50,19 +50,21 @@ class Guild(Hashable):
This is referred to as a "server" in the official Discord UI.
- Supported Operations:
-
- +-----------+-------------------------------------+
- | Operation | Description |
- +===========+=====================================+
- | x == y | Checks if two guilds are equal. |
- +-----------+-------------------------------------+
- | x != y | Checks if two guilds are not equal. |
- +-----------+-------------------------------------+
- | hash(x) | Returns the guild's hash. |
- +-----------+-------------------------------------+
- | str(x) | Returns the guild's name. |
- +-----------+-------------------------------------+
+ .. describe:: x == y
+
+ Checks if two guilds are equal.
+
+ .. describe:: x != y
+
+ Checks if two guilds are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the guild's hash.
+
+ .. describe:: str(x)
+
+ Returns the guild's name.
Attributes
----------
diff --git a/discord/invite.py b/discord/invite.py
index 44aa90f6..2139500c 100644
--- a/discord/invite.py
+++ b/discord/invite.py
@@ -36,19 +36,21 @@ class Invite(Hashable):
Depending on the way this object was created, some of the attributes can
have a value of ``None``.
- Supported Operations:
-
- +-----------+--------------------------------------+
- | Operation | Description |
- +===========+======================================+
- | x == y | Checks if two invites are equal. |
- +-----------+--------------------------------------+
- | x != y | Checks if two invites are not equal. |
- +-----------+--------------------------------------+
- | hash(x) | Return the invite's hash. |
- +-----------+--------------------------------------+
- | str(x) | Returns the invite's URL. |
- +-----------+--------------------------------------+
+ .. describe:: x == y
+
+ Checks if two invites are equal.
+
+ .. describe:: x != y
+
+ Checks if two invites are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the invite hash.
+
+ .. describe:: str(x)
+
+ Returns the invite URL.
Attributes
-----------
diff --git a/discord/member.py b/discord/member.py
index c5d0f45c..7dc08df4 100644
--- a/discord/member.py
+++ b/discord/member.py
@@ -112,19 +112,23 @@ class Member(discord.abc.Messageable):
This implements a lot of the functionality of :class:`User`.
- Supported Operations:
-
- +-----------+-----------------------------------------------+
- | Operation | Description |
- +===========+===============================================+
- | x == y | Checks if two members are equal. |
- +-----------+-----------------------------------------------+
- | x != y | Checks if two members are not equal. |
- +-----------+-----------------------------------------------+
- | hash(x) | Return the member's hash. |
- +-----------+-----------------------------------------------+
- | str(x) | Returns the member's name with discriminator. |
- +-----------+-----------------------------------------------+
+ .. describe:: x == y
+
+ Checks if two members are equal.
+ Note that this works with :class:`User` instances too.
+
+ .. describe:: x != y
+
+ Checks if two members are not equal.
+ Note that this works with :class:`User` instances too.
+
+ .. describe:: hash(x)
+
+ Returns the member's hash.
+
+ .. describe:: str(x)
+
+ Returns the member's name with the discriminator.
Attributes
----------
diff --git a/discord/reaction.py b/discord/reaction.py
index d4a7bcdf..96862074 100644
--- a/discord/reaction.py
+++ b/discord/reaction.py
@@ -32,19 +32,23 @@ class Reaction:
Depending on the way this object was created, some of the attributes can
have a value of ``None``.
- Similar to members, the same reaction to a different message are equal.
-
- Supported Operations:
-
- +-----------+-------------------------------------------+
- | Operation | Description |
- +===========+===========================================+
- | x == y | Checks if two reactions are the same. |
- +-----------+-------------------------------------------+
- | x != y | Checks if two reactions are not the same. |
- +-----------+-------------------------------------------+
- | hash(x) | Return the emoji's hash. |
- +-----------+-------------------------------------------+
+ .. 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".
+
+ .. describe:: x != y
+
+ Checks if two reactions are not equal.
+
+ .. describe:: hash(x)
+
+ Returns the reaction's hash.
+
+ .. describe:: str(x)
+
+ Returns the channel's name.
Attributes
-----------
diff --git a/discord/role.py b/discord/role.py
index 088a076b..d19a5bec 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -35,27 +35,37 @@ from .utils import snowflake_time
class Role(Hashable):
"""Represents a Discord role in a :class:`Guild`.
- Supported Operations:
-
- +-----------+------------------------------------------------------------------+
- | Operation | Description |
- +===========+==================================================================+
- | x == y | Checks if two roles are equal. |
- +-----------+------------------------------------------------------------------+
- | x != y | Checks if two roles are not equal. |
- +-----------+------------------------------------------------------------------+
- | x > y | Checks if a role is higher than another in the hierarchy. |
- +-----------+------------------------------------------------------------------+
- | x < y | Checks if a role is lower than another in the hierarchy. |
- +-----------+------------------------------------------------------------------+
- | x >= y | Checks if a role is higher or equal to another in the hierarchy. |
- +-----------+------------------------------------------------------------------+
- | x <= y | Checks if a role is lower or equal to another in the hierarchy. |
- +-----------+------------------------------------------------------------------+
- | hash(x) | Return the role's hash. |
- +-----------+------------------------------------------------------------------+
- | str(x) | Returns the role's name. |
- +-----------+------------------------------------------------------------------+
+ .. describe:: x == y
+
+ Checks if two roles are equal.
+
+ .. describe:: x != y
+
+ Checks if two roles are not equal.
+
+ .. describe:: x > y
+
+ Checks if a role is higher than another in the hierarchy.
+
+ .. describe:: x < y
+
+ Checks if a role is lower than another in the hierarchy.
+
+ .. describe:: x >= y
+
+ Checks if a role is higher or equal to another in the hierarchy.
+
+ .. describe:: x <= y
+
+ Checks if a role is lower or equal to another in the hierarchy.
+
+ .. describe:: hash(x)
+
+ Return the role's hash.
+
+ .. describe:: str(x)
+
+ Returns the role's name.
Attributes
----------
diff --git a/discord/user.py b/discord/user.py
index 2f3bfade..e7171b3c 100644
--- a/discord/user.py
+++ b/discord/user.py
@@ -175,19 +175,21 @@ class BaseUser:
class ClientUser(BaseUser):
"""Represents your Discord user.
- Supported Operations:
-
- +-----------+---------------------------------------------+
- | Operation | Description |
- +===========+=============================================+
- | x == y | Checks if two users are equal. |
- +-----------+---------------------------------------------+
- | x != y | Checks if two users are not equal. |
- +-----------+---------------------------------------------+
- | hash(x) | Return the user's hash. |
- +-----------+---------------------------------------------+
- | str(x) | Returns the user's name with discriminator. |
- +-----------+---------------------------------------------+
+ .. describe:: x == y
+
+ Checks if two users are equal.
+
+ .. describe:: x != y
+
+ Checks if two users are not equal.
+
+ .. describe:: hash(x)
+
+ Return the user's hash.
+
+ .. describe:: str(x)
+
+ Returns the user's name with discriminator.
Attributes
-----------
@@ -382,19 +384,21 @@ class ClientUser(BaseUser):
class User(BaseUser, discord.abc.Messageable):
"""Represents a Discord user.
- Supported Operations:
-
- +-----------+---------------------------------------------+
- | Operation | Description |
- +===========+=============================================+
- | x == y | Checks if two users are equal. |
- +-----------+---------------------------------------------+
- | x != y | Checks if two users are not equal. |
- +-----------+---------------------------------------------+
- | hash(x) | Return the user's hash. |
- +-----------+---------------------------------------------+
- | str(x) | Returns the user's name with discriminator. |
- +-----------+---------------------------------------------+
+ .. describe:: x == y
+
+ Checks if two users are equal.
+
+ .. describe:: x != y
+
+ Checks if two users are not equal.
+
+ .. describe:: hash(x)
+
+ Return the user's hash.
+
+ .. describe:: str(x)
+
+ Returns the user's name with discriminator.
Attributes
-----------