Browse Source

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.
pull/460/head
khazhyk 8 years ago
parent
commit
d409196d3d
  1. 7
      discord/client.py

7
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)

Loading…
Cancel
Save