mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +00:00
Add Guild.vanity_url helper property
This commit is contained in:
parent
340f09a1c0
commit
71586836e1
@ -3117,6 +3117,16 @@ class Guild(Hashable):
|
|||||||
"""
|
"""
|
||||||
await self._state.http.unban(user.id, self.id, reason=reason)
|
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]:
|
async def vanity_invite(self) -> Optional[Invite]:
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user