aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-08-21 22:02:03 -0400
committerRapptz <[email protected]>2015-08-21 22:02:03 -0400
commitef7dd42f2821ccc2a70af96889c653733a91a065 (patch)
tree257dad5f5c031ce0b7cd75cecf6463914ee3b18a /examples
parentAdd the ability to delete messages (diff)
downloaddiscord.py-ef7dd42f2821ccc2a70af96889c653733a91a065.tar.xz
discord.py-ef7dd42f2821ccc2a70af96889c653733a91a065.zip
Add on_message_edit event.
Diffstat (limited to 'examples')
-rw-r--r--examples/edits.py16
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()