aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-09-04 08:30:59 -0400
committerRapptz <[email protected]>2015-09-04 08:30:59 -0400
commit5f69fe9b07fab9dfebccb563a24698404f4f403b (patch)
tree1e2fe3ee7f4660492eb77724c549cdc9f35a9ebd
parentAdd the ability to create channels. (diff)
downloaddiscord.py-5f69fe9b07fab9dfebccb563a24698404f4f403b.tar.xz
discord.py-5f69fe9b07fab9dfebccb563a24698404f4f403b.zip
Add ability to delete channels.
-rw-r--r--discord/client.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index 1304f1b5..0ce41d07 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -672,3 +672,14 @@ class Client(object):
return channel
return None
+
+ def delete_channel(self, channel):
+ """Deletes a :class:`Channel` from its respective :class:`Server`.
+
+ Note that you need proper permissions to delete the channel.
+
+ :param channel: The :class:`Channel` to delete.
+ """
+
+ url = '{0}/{1.id}'.format(endpoints.CHANNELS, channel)
+ requests.delete(url, headers=self.headers)