how to get bot to delete own message code example
Example 1: discord bot remove message
import discord.ext
bot = commands.Bot(";")
@bot.event
async def on_message(message):
if message.content.upper().startswith(";SAY"):
args = message.content.split(" ")
await bot.send_message(message.channel, "%s" % (" ".join(args[1:])))
await bot.delete_message(message)
Example 2: make the bot delete its own message
await ctx.send('You don\'t have the permission to use this command', delete_after=5)