Add the ability to accept invites.

This commit is contained in:
Rapptz committed 2015-09-05 00:57:52 -04:00
1 parent 4aecd5f7b5
commit eed4b428aa
2 files changed
+18 -1

No files matched your search

+7 -1
View File
@@ -80,7 +80,13 @@ class Invite(object):
self.inviter = User(**kwargs.get('inviter', {}))
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)