aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/client.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index fa87c521..173928da 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -576,3 +576,38 @@ class Client(object):
url = '{}/{}'.format(endpoints.CHANNELS, channel.id)
response = requests.delete(url, headers=self.headers)
+ def kick(self, server, user):
+ """Kicks a :class:`User` from their respective :class:`Server`.
+
+ You must have the proper permissions to kick a user in the server.
+
+ :param server: The :class:`Server` to kick the member from.
+ :param user: The :class:`User` to kick.
+ """
+
+ url = '{base}/{server}/members/{user}'.format(base=endpoints.SERVERS, server=server.id, user=user.id)
+ response = requests.delete(url, headers=self.headers)
+
+ def ban(self, server, user):
+ """Bans a :class:`User` from their respective :class:`Server`.
+
+ You must have the proper permissions to ban a user in the server.
+
+ :param server: The :class:`Server` to ban the member from.
+ :param user: The :class:`User` to ban.
+ """
+
+ url = '{base}/{server}/bans/{user}'.format(base=endpoints.SERVERS, server=server.id, user=user.id)
+ response = requests.put(url, headers=self.headers)
+
+ def unban(self, server, name):
+ """Unbans a :class:`User` from their respective :class:`Server`.
+
+ You must have the proper permissions to unban a user in the server.
+
+ :param server: The :class:`Server` to unban the member from.
+ :param user: The :class:`User` to unban.
+ """
+
+ url = '{base}/{server}/bans/{user}'.format(base=endpoints.SERVERS, server=server.id, user=user.id)
+ response = requests.delete(url, headers=self.headers)