Skip to content Skip to sidebar Skip to footer

Discord.py How Can I Make A Bot Delete Messages After A Specific Amount Of Time

I have a discord bot that sends images to users when they use the !img command, I don't want people to request an image and then have it sit there until someone deletes it. Is ther

Solution 1:

Messageable.send has a delete_after kwarg that takes the amount of seconds to delete the sent message after, for example

await channel.send("this message will be deleted after 10 seconds", delete_after=10)

https://discordpy.readthedocs.io/en/neo-docs/api.html#discord.abc.Messageable.send

Post a Comment for "Discord.py How Can I Make A Bot Delete Messages After A Specific Amount Of Time"