aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-09-29 05:51:40 -0400
committerRapptz <[email protected]>2017-09-29 05:54:29 -0400
commit711dfb83abae5486b70489e0151195ac4f316d52 (patch)
tree44cd778bb8f8cbc65f50a31293d9bfe02fa5d7cb /discord/http.py
parentFix Guild.system_channel always returning None. (diff)
downloaddiscord.py-711dfb83abae5486b70489e0151195ac4f316d52.tar.xz
discord.py-711dfb83abae5486b70489e0151195ac4f316d52.zip
Allow creating a channel with a category.
Diffstat (limited to 'discord/http.py')
-rw-r--r--discord/http.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/http.py b/discord/http.py
index ab2534e2..bcdfcfe6 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -511,7 +511,7 @@ class HTTPClient:
r = Route('PATCH', '/guilds/{guild_id}/channels', guild_id=guild_id)
return self.request(r, json=data, reason=reason)
- def create_channel(self, guild_id, name, channel_type, permission_overwrites=None, *, reason=None):
+ def create_channel(self, guild_id, name, channel_type, parent_id=None, permission_overwrites=None, *, reason=None):
payload = {
'name': name,
'type': channel_type
@@ -520,6 +520,9 @@ class HTTPClient:
if permission_overwrites is not None:
payload['permission_overwrites'] = permission_overwrites
+ if parent_id is not None:
+ payload['parent_id'] = parent_id
+
return self.request(Route('POST', '/guilds/{guild_id}/channels', guild_id=guild_id), json=payload, reason=reason)
def delete_channel(self, channel_id, *, reason=None):