I have seen this command
@bot.command()
async def disappear(ctx):
msg = await ctx.send("Hey!")
await msg.delete(delay=1)
However, I'm trying to delete the "msg" in some other function. To be precise, this is my code
@bot.command()
async def disappear(ctx):
msg = await ctx.send("Hey!")
await msg.delete(delay=1)
@bot.command()
async def somethingelse(ctx):
await msg.delete(delay=1)
which gives me an error
NameError: name 'msg' is not defined
So i wanted to know if there is any method where it is possible to delete the bot's previous message by the bot itself.