aboutsummaryrefslogtreecommitdiff
path: root/discord/server.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-10-24 05:10:58 -0400
committerRapptz <[email protected]>2015-10-24 05:10:58 -0400
commit5efddaf35def4559e8f2124bc4fc6bf8acb8b158 (patch)
tree2794b6184cbd434a2f5ddd6d256aad940b1ec5e0 /discord/server.py
parentAdd Channel.mention to mention a channel. (diff)
downloaddiscord.py-5efddaf35def4559e8f2124bc4fc6bf8acb8b158.tar.xz
discord.py-5efddaf35def4559e8f2124bc4fc6bf8acb8b158.zip
Support unavailable servers.
Diffstat (limited to 'discord/server.py')
-rw-r--r--discord/server.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/discord/server.py b/discord/server.py
index 4004967a..d5809032 100644
--- a/discord/server.py
+++ b/discord/server.py
@@ -136,6 +136,13 @@ class Server(object):
.. attribute:: owner
The :class:`Member` who owns the server.
+ .. attribute:: unavailable
+
+ A boolean indicating if the server is unavailable. If this is ``True`` then the
+ reliability of other attributes outside of :meth:`Server.id` is slim and they might
+ all be None. It is best to not do anything with the server if it is unavailable.
+
+ Check the :func:`on_server_unavailable` and :func:`on_server_available` events.
"""
def __init__(self, **kwargs):
@@ -148,6 +155,7 @@ class Server(object):
self.icon = kwargs.get('icon')
self.id = kwargs.get('id')
self.owner = kwargs.get('owner')
+ self.unavailable = kwargs.get('unavailable', False)
def get_default_role(self):
"""Gets the @everyone role that all members have by default."""