diff options
| author | Rapptz <[email protected]> | 2015-08-21 22:02:03 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-08-21 22:02:03 -0400 |
| commit | ef7dd42f2821ccc2a70af96889c653733a91a065 (patch) | |
| tree | 257dad5f5c031ce0b7cd75cecf6463914ee3b18a /examples | |
| parent | Add the ability to delete messages (diff) | |
| download | discord.py-ef7dd42f2821ccc2a70af96889c653733a91a065.tar.xz discord.py-ef7dd42f2821ccc2a70af96889c653733a91a065.zip | |
Add on_message_edit event.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/edits.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/edits.py b/examples/edits.py new file mode 100644 index 00000000..c1619cec --- /dev/null +++ b/examples/edits.py @@ -0,0 +1,16 @@ +import discord + +client = discord.Client() +client.login('email', 'password') + +def on_ready(): + print('Connected!') + print('Username: ' + client.user.name) + print('ID: ' + client.user.id) + +def on_message_edit(before, after): + client.send_message(after.channel, '**{}** edited their message:\n{}'.format(after.author.name, before.content)) + +client.run() |