Add the ability to edit messages.

This commit is contained in:
Rapptz
2015-08-21 22:53:47 -04:00
parent ef7dd42f28
commit b102ac4b2a
2 changed files with 44 additions and 8 deletions

View File

@ -1,4 +1,5 @@
import discord
import time
client = discord.Client()
client.login('email', 'password')
@ -9,6 +10,13 @@ def on_ready():
print('Username: ' + client.user.name)
print('ID: ' + client.user.id)
@client.event
def on_message(message):
if message.content.startswith('!editme'):
msg = client.send_message(message.author, '10')
time.sleep(3)
client.edit_message(msg, '40')
@client.event
def on_message_edit(before, after):
client.send_message(after.channel, '**{}** edited their message:\n{}'.format(after.author.name, before.content))