Add Guild.vanity_url helper property

This commit is contained in:
Rapptz 2022-03-10 05:06:02 -05:00
parent 340f09a1c0
commit 71586836e1

View File

@ -3117,6 +3117,16 @@ class Guild(Hashable):
"""
await self._state.http.unban(user.id, self.id, reason=reason)
@property
def vanity_url(self) -> Optional[str]:
"""Optional[:class:`str`]: The Discord vanity invite URL for this guild, if available.
.. versionadded:: 2.0
"""
if self.vanity_url_code is None:
return None
return f'{Invite.BASE}/{self.vanity_url_code}'
async def vanity_invite(self) -> Optional[Invite]:
"""|coro|