Temporary Messages (Self Deleting)
Would love to have a built in method/call to let bots create temporary messages that can be sent with a set lifetime and automatically removed by Discord when they expire. I've coded a number of Discord bots in a number of different languages, and each one I've used a different method to create temporary messages that automatically delete themselves.
One uses a custom garbage collector that occasionally parses the cache for temps. One uses a custom function that kicks off a separate thread with every message that deletes the message after waiting a few minutes. One applies a special set of invisible characters to temp messages that a heartbeat function occasional picks up on to delete the message later.
There's a million different ways to do it. But it would be amazing if it was a built in capability.
8
-
If you using the Python Discord.py API, you can make:
await ctx.send("text", delete_after=1)2 -
There's a way to do it with all the APIs, some long some small, but it would be so much better to have it built-in. That way more bot devs will have easier access to it and we may see a day when all bot spam is self-cleaning. :D
I use it for error messages, instructions, command syntax help, and extra information that doesn't need to stick around.
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires