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
644 B
20 lines
644 B
import discord
|
|
import asyncio
|
|
|
|
class MyClient(discord.Client):
|
|
async def on_ready(self):
|
|
print('Connected!')
|
|
print('Username: {0.name}\nID: {0.id}'.format(self.user))
|
|
|
|
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):
|
|
fmt = '**{0.author}** edited their message:\n{0.content} -> {1.content}'
|
|
await before.channel.send(fmt.format(before, after))
|
|
|
|
client = MyClient()
|
|
client.run('token')
|
|
|