mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-03 00:25:14 +00:00
Add on_message_delete event and Client.messages attribute.
This commit is contained in:
16
examples/deleted.py
Normal file
16
examples/deleted.py
Normal file
@ -0,0 +1,16 @@
|
||||
import discord
|
||||
|
||||
client = discord.Client()
|
||||
client.login('email', 'password')
|
||||
|
||||
@client.event
|
||||
def on_ready():
|
||||
print('Connected!')
|
||||
print('Username: ' + client.user.name)
|
||||
print('ID: ' + client.user.id)
|
||||
|
||||
@client.event
|
||||
def on_message_delete(message):
|
||||
client.send_message(message.channel, '{} has deleted the message:\n{}'.format(message.author.name, message.content))
|
||||
|
||||
client.run()
|
Reference in New Issue
Block a user