Answers for "discord message.delete"

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)
Posted by: Guest on January-24-2021
2

discord delete message

"create a variable called id"
var id
"then inside your client message statement change id ->  id = message.id"
client.on('message', message => {
  id = message.id
});
"inside your command type  message.fetch(id).then(msg => msg.delete());"
  if (message.content === !test)
      message.fetch(id).then(msg => msg.delete());      
}});
Posted by: Guest on October-25-2020

Code answers related to "Assembly"

Browse Popular Code Answers by Language