aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkhazhyk <[email protected]>2017-01-22 12:57:11 -0800
committerkhazhyk <[email protected]>2017-01-22 13:01:06 -0800
commitd409196d3d4bf42894bb4d9e4989168f340362b7 (patch)
tree58a65381e9ccd2b89c38662d3e1afd3522e6335f
parentVersion bump to v0.16.5 (diff)
downloaddiscord.py-d409196d3d4bf42894bb4d9e4989168f340362b7.tar.xz
discord.py-d409196d3d4bf42894bb4d9e4989168f340362b7.zip
Fix Client.create_server.
Client was using .name of enum instead of .value, resulting in invalid requests being sent to discord. edit_server region changing was not broken as the region field was str()'d, which uses .value. Also document that most bot accounts cannot use create_server.
-rw-r--r--discord/client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py
index be0ebb0d..c7c7f08a 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -2242,6 +2242,9 @@ class Client:
Creates a :class:`Server`.
+ Bot accounts generally are not allowed to create servers.
+ See Discord's official documentation for more info.
+
Parameters
----------
name : str
@@ -2270,9 +2273,9 @@ class Client:
icon = utils._bytes_to_base64_data(icon)
if region is None:
- region = ServerRegion.us_west.name
+ region = ServerRegion.us_west.value
else:
- region = region.name
+ region = region.value
data = yield from self.http.create_server(name, region, icon)
return Server(**data)