From eed4b428aaf75d4b94687fa8cae83ed3c96bd49b Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sat, 5 Sep 2015 00:57:39 -0400 Subject: Add the ability to accept invites. --- discord/invite.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'discord/invite.py') diff --git a/discord/invite.py b/discord/invite.py index 39897b44..24af7ce2 100644 --- a/discord/invite.py +++ b/discord/invite.py @@ -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) + -- cgit v1.2.3