aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
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()