mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +00:00
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.
This commit is contained in:
parent
ea95d723e8
commit
d409196d3d
@ -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…
x
Reference in New Issue
Block a user