You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
636 B

import discord
import asyncio
class MyClient(discord.Client):
async def on_ready(self):
print('Connected!')
print(f'Username: {self.user.name}\nID: {self.user.id}')
async def on_message(self, message):
if message.content.startswith('!editme'):
msg = await message.channel.send('10')
await asyncio.sleep(3.0)
await msg.edit(content='40')
async def on_message_edit(self, before, after):
msg = f'**{before.author}** edited their message:\n{before.content} -> {after.content}'
await before.channel.send(msg)
client = MyClient()
client.run('token')