import discord
@client.event
async def on_message(message):
response = await message.channel.send("Hello")
# Deletes the message the user sent
await message.delete()
# Deletes the responding message
await response.delete()
async def on_message(self,message):
channel = bot.get_channel(channel_id)
if message.content.startswith("!clear",):
messages = await channel.history(limit=anynumber).flatten()
for m in messages:
msg = await channel.fetch_message(m.id)
await msg.delete()
print("done!")