Reputation: 164
I have a command that sends a message in the users dm. But after some time I want to delete that message. How can I do that? I've been trying to find a way but I can't. Thanks
Upvotes: 0
Views: 344
Reputation: 3426
Use asyncio.sleep(NUM_OF_SEC)
@bot.command()
async def private(ctx):
msg = await ctx.author.send('This is private')
await asyncio.sleep(3) # number of seconds
await msg.delete()
Upvotes: 1