diff options
| author | NCPlayz <[email protected]> | 2019-03-14 12:38:02 +0000 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-03-19 09:00:18 -0400 |
| commit | f507f508a2aa56305ac90bd222f49af9cf47c49b (patch) | |
| tree | a9ba58dde45156651f76196c06514a622e7fa6a8 /discord/guild.py | |
| parent | Organise documentation (diff) | |
| download | discord.py-f507f508a2aa56305ac90bd222f49af9cf47c49b.tar.xz discord.py-f507f508a2aa56305ac90bd222f49af9cf47c49b.zip | |
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
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/discord/guild.py b/discord/guild.py index fd83acf6..e2d704b3 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -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 |