Expose Metadata

Added access to:
* `/users/@me/guilds`
* `/guilds/{guild_id}`
* `/guilds/{guild_id}/members/{member_id}`

BREAKING CHANGE:
* `get_user_info` -> `fetch_user_info` to match naming scheme.

Remove useless note

Remove `reverse` and corresponding documentation

Update documentation to reflect #1988

Rename `get_` HTTP functions to `fetch_`

Breaking Changes:
* `get_message` -> `fetch_message`
* `get_invite` -> `fetch_invite`
* `get_user_profile` -> `fetch_user_profile`
* `get_webhook_info` -> `fetch_webhook`
* `get_ban` -> `fetch_ban`

Fix InviteConverter, update migrating.rst

Rename get_message to fetch_message
This commit is contained in:
NCPlayz
2019-03-14 12:38:02 +00:00
committed by Rapptz
parent fb02191b80
commit f507f508a2
7 changed files with 260 additions and 10 deletions

View File

@ -944,7 +944,32 @@ class Guild(Hashable):
fields['explicit_content_filter'] = explicit_content_filter.value
await http.edit_guild(self.id, reason=reason, **fields)
async def get_ban(self, user):
async def fetch_member(self, member_id):
"""|coro|
Retreives a :class:`Member` from a guild ID, and a member ID.
Parameters
-----------
member_id: :class:`int`
The member's ID to fetch from.
Raises
-------
Forbidden
You do not have access to the guild.
HTTPException
Getting the guild failed.
Returns
--------
:class:`Member`
The member from the member ID.
"""
data = await self._state.http.get_member(self.id, member_id)
return Member(data=data, state=self._state, guild=self)
async def fetch_ban(self, user):
"""|coro|
Retrieves the :class:`BanEntry` for a user, which is a namedtuple