diff options
| author | Rapptz <[email protected]> | 2015-08-21 20:56:40 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-08-21 20:58:51 -0400 |
| commit | 794991adb6bfa6d66b2b977b1d2a6dcb639398d0 (patch) | |
| tree | cc317ab012a3a9949be759f7042387c043c93d4f /discord | |
| parent | Return the message created when calling send_message (diff) | |
| download | discord.py-794991adb6bfa6d66b2b977b1d2a6dcb639398d0.tar.xz discord.py-794991adb6bfa6d66b2b977b1d2a6dcb639398d0.zip | |
Add the ability to delete messages
Diffstat (limited to 'discord')
| -rw-r--r-- | discord/client.py | 9 |
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. |