mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 10:49:24 +00:00
Document BanEntry
This commit is contained in:
parent
b86073fac3
commit
66b834b332
@ -1346,9 +1346,7 @@ class Guild(Hashable):
|
|||||||
async def fetch_ban(self, user):
|
async def fetch_ban(self, user):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Retrieves the :class:`BanEntry` for a user, which is a namedtuple
|
Retrieves the :class:`BanEntry` for a user.
|
||||||
with a ``user`` and ``reason`` field. See :meth:`bans` for more
|
|
||||||
information.
|
|
||||||
|
|
||||||
You must have the :attr:`~Permissions.ban_members` permission
|
You must have the :attr:`~Permissions.ban_members` permission
|
||||||
to get this information.
|
to get this information.
|
||||||
@ -1369,8 +1367,8 @@ class Guild(Hashable):
|
|||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
BanEntry
|
:class:`BanEntry`
|
||||||
The BanEntry object for the specified user.
|
The :class:`BanEntry` object for the specified user.
|
||||||
"""
|
"""
|
||||||
data = await self._state.http.get_ban(user.id, self.id)
|
data = await self._state.http.get_ban(user.id, self.id)
|
||||||
return BanEntry(
|
return BanEntry(
|
||||||
@ -1381,12 +1379,7 @@ class Guild(Hashable):
|
|||||||
async def bans(self):
|
async def bans(self):
|
||||||
"""|coro|
|
"""|coro|
|
||||||
|
|
||||||
Retrieves all the users that are banned from the guild.
|
Retrieves all the users that are banned from the guild as a :class:`list` of :class:`BanEntry`.
|
||||||
|
|
||||||
This coroutine returns a :class:`list` of BanEntry objects, which is a
|
|
||||||
namedtuple with a ``user`` field to denote the :class:`User`
|
|
||||||
that got banned along with a ``reason`` field specifying
|
|
||||||
why the user was banned that could be set to ``None``.
|
|
||||||
|
|
||||||
You must have the :attr:`~Permissions.ban_members` permission
|
You must have the :attr:`~Permissions.ban_members` permission
|
||||||
to get this information.
|
to get this information.
|
||||||
@ -1400,8 +1393,8 @@ class Guild(Hashable):
|
|||||||
|
|
||||||
Returns
|
Returns
|
||||||
--------
|
--------
|
||||||
List[BanEntry]
|
List[:class:`BanEntry`]
|
||||||
A list of BanEntry objects.
|
A list of :class:`BanEntry` objects.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
data = await self._state.http.get_bans(self.id)
|
data = await self._state.http.get_bans(self.id)
|
||||||
|
16
docs/api.rst
16
docs/api.rst
@ -2867,6 +2867,22 @@ Guild
|
|||||||
.. automethod:: audit_logs
|
.. automethod:: audit_logs
|
||||||
:async-for:
|
:async-for:
|
||||||
|
|
||||||
|
.. class:: BanEntry
|
||||||
|
|
||||||
|
A namedtuple which represents a ban returned from :meth:`~Guild.bans`.
|
||||||
|
|
||||||
|
.. attribute:: reason
|
||||||
|
|
||||||
|
The reason this user was banned.
|
||||||
|
|
||||||
|
:type: Optional[:class:`str`]
|
||||||
|
.. attribute:: user
|
||||||
|
|
||||||
|
The :class:`User` that was banned.
|
||||||
|
|
||||||
|
:type: :class:`User`
|
||||||
|
|
||||||
|
|
||||||
Integration
|
Integration
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user