aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-31 20:57:53 -0500
committerRapptz <[email protected]>2015-12-31 20:57:53 -0500
commit6d94e68c7a2e02bd6fd37ebcae3acbf7d68096ec (patch)
tree191be1833f6afe6346ade583d5796643822e3d3e
parentFix issue with add_roles and friends not working. (diff)
downloaddiscord.py-6d94e68c7a2e02bd6fd37ebcae3acbf7d68096ec.tar.xz
discord.py-6d94e68c7a2e02bd6fd37ebcae3acbf7d68096ec.zip
Actually send the payload data in Client.create_server
-rw-r--r--discord/client.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/discord/client.py b/discord/client.py
index a1fc1b22..6bb4b036 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -1613,7 +1613,18 @@ class Client:
if icon is not None:
icon = utils._bytes_to_base64_data(icon)
- r = yield from aiohttp.post(endpoints.SERVERS, headers=self.headers, loop=self.loop)
+ if region is None:
+ region = ServerRegion.us_west.name
+ else:
+ region = region.name
+
+ payload = {
+ 'icon': icon,
+ 'name': name,
+ 'region': region
+ }
+
+ r = yield from aiohttp.post(endpoints.SERVERS, data=utils.to_json(payload), headers=self.headers, loop=self.loop)
log.debug(request_logging_format.format(method='POST', response=r))
yield from utils._verify_successful_response(r)
data = yield from r.json()