diff options
| author | Rapptz <[email protected]> | 2017-08-30 17:58:53 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-08-30 17:58:53 -0400 |
| commit | 63bca6604bd62347858c211aead46c1e4501435a (patch) | |
| tree | 02879b3552799aa21ed0241ad193b53d7b259f00 | |
| parent | Fix utils.get example. (diff) | |
| download | discord.py-63bca6604bd62347858c211aead46c1e4501435a.tar.xz discord.py-63bca6604bd62347858c211aead46c1e4501435a.zip | |
Manually format reason parameter for kick and ban.
Related to: https://github.com/aio-libs/aiohttp/issues/2235
| -rw-r--r-- | discord/http.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/discord/http.py b/discord/http.py index 0d674706..aca91bb6 100644 --- a/discord/http.py +++ b/discord/http.py @@ -431,7 +431,9 @@ class HTTPClient: def kick(self, user_id, guild_id, reason=None): r = Route('DELETE', '/guilds/{guild_id}/members/{user_id}', guild_id=guild_id, user_id=user_id) if reason: - return self.request(r, params={'reason': reason }) + # thanks aiohttp + r.url = '{0.url}?reason={1}'.format(r, _uriquote(reason)) + return self.request(r) def ban(self, user_id, guild_id, delete_message_days=1, reason=None): @@ -439,8 +441,10 @@ class HTTPClient: params = { 'delete-message-days': delete_message_days, } + if reason: - params['reason'] = reason + # thanks aiohttp + r.url = '{0.url}?reason={1}'.format(r, _uriquote(reason)) return self.request(r, params=params) |