aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-04 22:13:17 -0500
committerRapptz <[email protected]>2015-12-04 22:13:17 -0500
commit79bdf2a72174a634aad0a752cad60d96ee8336f6 (patch)
tree866d7d4ac7cf19071c7190ab4c9a749eedb2c851 /docs
parentAdd channel management functions (diff)
downloaddiscord.py-79bdf2a72174a634aad0a752cad60d96ee8336f6.tar.xz
discord.py-79bdf2a72174a634aad0a752cad60d96ee8336f6.zip
Add enumerators instead of strings.
Changes channel type, status and server region into 3.4 enums.
Diffstat (limited to 'docs')
-rw-r--r--docs/api.rst61
1 files changed, 61 insertions, 0 deletions
diff --git a/docs/api.rst b/docs/api.rst
index 59efac78..93b2c239 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -297,6 +297,67 @@ Utility Functions
.. autofunction:: discord.utils.find
+Enumerators
+------------
+
+The API provides some enumerators for certain types of strings to avoid the API
+from being stringly typed in case the strings change in the future.
+
+All enumerators are subclasses of `enum`_.
+
+.. _enum: https://docs.python.org/3/library/enum.html
+
+.. class:: ChannelType
+
+ Specifies the type of :class:`Channel`.
+
+ .. attribute:: text
+
+ A text channel.
+ .. attribute:: voice
+
+ A voice channel.
+
+.. class:: ServerRegion
+
+ Specifies the region a :class:`Server`'s voice server belongs to.
+
+ .. attribute:: us_west
+
+ The US West region.
+ .. attribute:: us_east
+
+ The US East region.
+ .. attribute:: singapore
+
+ The Singapore region.
+ .. attribute:: london
+
+ The London region.
+ .. attribute:: sydney
+
+ The Sydney region.
+ .. attribute:: amsterdam
+
+ The Amsterdam region.
+ .. attribute:: frankfurt
+
+ The Frankfurt region.
+
+.. class:: Status
+
+ Specifies a :class:`Member` 's status.
+
+ .. attribute:: online
+
+ The member is online.
+ .. attribute:: offline
+
+ The member is offline.
+ .. attribute:: idle
+
+ The member is idle.
+
Data Classes
--------------