Add the ability to accept invites.

This commit is contained in:
Rapptz
2015-09-05 00:57:39 -04:00
parent 4aecd5f7b5
commit eed4b428aa
2 changed files with 18 additions and 1 deletions

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)