aboutsummaryrefslogtreecommitdiff
path: root/examples/deleted.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2015-12-06 03:05:50 -0500
committerRapptz <[email protected]>2015-12-06 03:10:18 -0500
commite87d54dd12c2a655e6e075abd8e2d03ce3b6d059 (patch)
treeabb8657ecc8f57b64159dc17a282f0a8c1cdb9b1 /examples/deleted.py
parentForced keyword argument for allow/deny in edit_channel_permissions (diff)
downloaddiscord.py-e87d54dd12c2a655e6e075abd8e2d03ce3b6d059.tar.xz
discord.py-e87d54dd12c2a655e6e075abd8e2d03ce3b6d059.zip
Update example code.
Diffstat (limited to 'examples/deleted.py')
-rw-r--r--examples/deleted.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/examples/deleted.py b/examples/deleted.py
index 7f77e9c3..ca65ddc9 100644
--- a/examples/deleted.py
+++ b/examples/deleted.py
@@ -1,22 +1,22 @@
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(message):
if message.content.startswith('!deleteme'):
- msg = client.send_message(message.channel, 'I will delete myself now...')
- client.delete_message(msg)
+ msg = yield from client.send_message(message.channel, 'I will delete myself now...')
+ yield from client.delete_message(msg)
def on_message_delete(message):
- client.send_message(message.channel, '{} has deleted the message:\n{}'.format(message.author.name, message.content))
+ fmt = '{0.author.name} has deleted the message:\n{0.content}'
+ yield from client.send_message(message.channel, fmt.format(message))
-client.run()
+client.run('email', 'password')