aboutsummaryrefslogtreecommitdiff
path: root/discord/invite.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-10-17 06:02:18 -0400
committerRapptz <[email protected]>2017-01-03 09:51:53 -0500
commitf33eaa4a611824dd831b3df4ddd9857fb66687c1 (patch)
treee88d958e761e0a6b75d4ade1dce810c40b892444 /discord/invite.py
parentAdd MessageChannel.typing context manager for prolonged typing. (diff)
downloaddiscord.py-f33eaa4a611824dd831b3df4ddd9857fb66687c1.tar.xz
discord.py-f33eaa4a611824dd831b3df4ddd9857fb66687c1.zip
Stateful Message and remove Invite.xkcd since it is removed.
Diffstat (limited to 'discord/invite.py')
-rw-r--r--discord/invite.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/discord/invite.py b/discord/invite.py
index 4e19b2d6..91136ac2 100644
--- a/discord/invite.py
+++ b/discord/invite.py
@@ -50,34 +50,32 @@ class Invite(Hashable):
Attributes
-----------
- max_age : int
+ max_age: int
How long the before the invite expires in seconds. A value of 0 indicates that it doesn't expire.
- code : str
+ code: str
The URL fragment used for the invite. :attr:`xkcd` is also a possible fragment.
- server : :class:`Server`
+ server: :class:`Server`
The server the invite is for.
- revoked : bool
+ revoked: bool
Indicates if the invite has been revoked.
- created_at : `datetime.datetime`
+ created_at: `datetime.datetime`
A datetime object denoting the time the invite was created.
- temporary : bool
+ temporary: bool
Indicates that the invite grants temporary membership.
If True, members who joined via this invite will be kicked upon disconnect.
- uses : int
+ uses: int
How many times the invite has been used.
- max_uses : int
+ max_uses: int
How many times the invite can be used.
- xkcd : str
- The URL fragment used for the invite if it is human readable.
- inviter : :class:`User`
+ inviter: :class:`User`
The user who created the invite.
- channel : :class:`Channel`
+ channel: :class:`Channel`
The channel the invite is for.
"""
__slots__ = ( 'max_age', 'code', 'server', 'revoked', 'created_at', 'uses',
- 'temporary', 'max_uses', 'xkcd', 'inviter', 'channel', '_state' )
+ 'temporary', 'max_uses', 'inviter', 'channel', '_state' )
def __init__(self, *, state, data):
self._state = state
@@ -89,7 +87,6 @@ class Invite(Hashable):
self.temporary = data.get('temporary')
self.uses = data.get('uses')
self.max_uses = data.get('max_uses')
- self.xkcd = data.get('xkcdpass')
inviter_data = data.get('inviter')
self.inviter = None if inviter_data is None else User(state=state, data=data)
@@ -101,7 +98,7 @@ class Invite(Hashable):
@property
def id(self):
"""Returns the proper code portion of the invite."""
- return self.xkcd if self.xkcd else self.code
+ return self.code
@property
def url(self):