aboutsummaryrefslogtreecommitdiff
path: root/discord/http.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2016-06-14 20:48:41 -0400
committerRapptz <[email protected]>2016-06-14 22:26:14 -0400
commitf0fc70b2cf88d64bf38dc737ebf182bb22b90852 (patch)
treeea5bafe6b96dc0565506cdb7417c8658a4db36c9 /discord/http.py
parentFix bug with editing messages over private messages. (diff)
downloaddiscord.py-f0fc70b2cf88d64bf38dc737ebf182bb22b90852.tar.xz
discord.py-f0fc70b2cf88d64bf38dc737ebf182bb22b90852.zip
Add a way to set permission overwrites when creating a channel.
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 aa5ef47a..9cd46bad 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -344,13 +344,16 @@ class HTTPClient:
return self.patch(url, json=payload, bucket=_func_())
- def create_channel(self, guild_id, name, channe_type):
+ def create_channel(self, guild_id, name, channe_type, permission_overwrites=None):
url = '{0.GUILDS}/{1}/channels'.format(self, guild_id)
payload = {
'name': name,
'type': channe_type
}
+ if permission_overwrites is not None:
+ payload['permission_overwrites'] = permission_overwrites
+
return self.post(url, json=payload, bucket=_func_())
def delete_channel(self, channel_id):