aboutsummaryrefslogtreecommitdiff
path: root/discord/invite.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-09-05 00:57:39 -0400
committerRapptz <[email protected]>2015-09-05 00:57:52 -0400
commiteed4b428aaf75d4b94687fa8cae83ed3c96bd49b (patch)
tree3c400111b2eb904b12db718051a449a8cf779284 /discord/invite.py
parentAdd on_error event for doing something about uncaught exceptions. (diff)
downloaddiscord.py-eed4b428aaf75d4b94687fa8cae83ed3c96bd49b.tar.xz
discord.py-eed4b428aaf75d4b94687fa8cae83ed3c96bd49b.zip
Add the ability to accept invites.
Diffstat (limited to 'discord/invite.py')
-rw-r--r--discord/invite.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/discord/invite.py b/discord/invite.py
index 39897b44..24af7ce2 100644
--- a/discord/invite.py
+++ b/discord/invite.py
@@ -81,6 +81,12 @@ class Invite(object):
self.channel = kwargs.get('channel')
@property
+ def id(self):
+ """Returns the proper code portion of the invite."""
+ return self.xkcd if self.xkcd else self.code
+
+ @property
def url(self):
"""A property that retrieves the invite URL."""
- return 'http://discord.gg/{}'.format(self.xkcd if self.xkcd else self.code)
+ return 'http://discord.gg/{}'.format(self.id)
+