Make the bot delete its own message

Code examples

0
0

make the bot delete its own message

await ctx.send('You don\'t have the permission to use this command', delete_after=5) 
0
0

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)

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................