aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-08-21 20:56:40 -0400
committerRapptz <[email protected]>2015-08-21 20:58:51 -0400
commit794991adb6bfa6d66b2b977b1d2a6dcb639398d0 (patch)
treecc317ab012a3a9949be759f7042387c043c93d4f /discord
parentReturn the message created when calling send_message (diff)
downloaddiscord.py-794991adb6bfa6d66b2b977b1d2a6dcb639398d0.tar.xz
discord.py-794991adb6bfa6d66b2b977b1d2a6dcb639398d0.zip
Add the ability to delete messages
Diffstat (limited to 'discord')
-rw-r--r--discord/client.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/discord/client.py b/discord/client.py
index bd74ac29..19b84b8b 100644
--- a/discord/client.py
+++ b/discord/client.py
@@ -264,6 +264,15 @@ class Client(object):
message = Message(channel=channel, **response.json())
return message
+ def delete_message(self, message):
+ """Deletes a :class:`Message`
+
+ A fairly straightforward function.
+
+ :param message: The :class:`Message` to delete.
+ """
+ url = '{}/{}/messages/{}'.format(endpoints.CHANNELS, message.channel.id, message.id)
+ response = requests.delete(url, headers=self.headers)
def login(self, email, password):
"""Logs in the user with the following credentials.