From 54f8f847e805073df235c67e026fb3aaf77fd996 Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 14 Jul 2019 07:04:31 +0100 Subject: [PATCH] Replace get_vanity_url function with vanity_url property on guild object. --- disco/types/guild.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/disco/types/guild.py b/disco/types/guild.py index d9ca2e5..791689f 100644 --- a/disco/types/guild.py +++ b/disco/types/guild.py @@ -357,6 +357,11 @@ class Guild(SlottedModel, Permissible): def owner(self): return self.members.get(self.owner_id) + @property + def vanity_url(self): + if self.vanity_url_code: + return 'https://discord.gg/' + self.vanity_url_code + def get_permissions(self, member): """ Get the permissions a user has in this guild. @@ -517,9 +522,6 @@ class Guild(SlottedModel, Permissible): def get_invites(self): return self.client.api.guilds_invites_list(self.id) - def get_vanity_url(self): - return self.client.api.guilds_vanity_url_get(self.id) - def get_emojis(self): return self.client.api.guilds_emojis_list(self.id)