aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-16 19:32:08 -0500
committerRapptz <[email protected]>2015-12-16 19:32:08 -0500
commit271c7565fcf80d7e9f6bc46797d1a94a743d4b67 (patch)
treee80bc6f7baa66305a26c1bac8794eea49cef5861
parentFix issue with roles being passed in being strings. (diff)
downloaddiscord.py-271c7565fcf80d7e9f6bc46797d1a94a743d4b67.tar.xz
discord.py-271c7565fcf80d7e9f6bc46797d1a94a743d4b67.zip
Make Client.unban actually useful.
-rw-r--r--discord/client.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/discord/client.py b/discord/client.py
index b23082cf..21fe412e 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -1181,21 +1181,17 @@ class Client:
yield from response.release()
@asyncio.coroutine
- def unban(self, member):
+ def unban(self, server, user):
"""|coro|
- Unbans a :class:`Member` from the server they belong to.
-
- Warning
- --------
- This function unbans the :class:`Member` based on the server it
- belongs to, which is accessed via :attr:`Member.server`. So you
- must have the proper permissions in that server.
+ Unbans a :class:`User` from the server they are banned from.
Parameters
-----------
- member : :class:`Member`
- The member to unban from their server.
+ server : :class:`Server`
+ The server to unban the user from.
+ user : :class:`User`
+ The user to unban.
Raises
-------
@@ -1205,7 +1201,7 @@ class Client:
Unbanning failed.
"""
- url = '{0}/{1.server.id}/bans/{1.id}'.format(endpoints.SERVERS, member)
+ url = '{0}/{1.id}/bans/{2.id}'.format(endpoints.SERVERS, server, user)
response = yield from aiohttp.delete(url, headers=self.headers, loop=self.loop)
log.debug(request_logging_format.format(method='DELETE', response=response))
yield from utils._verify_successful_response(response)