You can use https://github.com/victornpb/undiscord to mass delete either your entire account/a server/a channel’s messages you’ve send.
I’ve send an email to Discord regarding this problem and they gave me this answer
We try to balance the interests other users have in a conversation, as well as the ability for us to provide the service as a whole. Discord is a communications service and its users have a legitimate interest in having access to content sent to them. Consistent with GDPR, Discord balances the privacy interests of the user against the interests other users have in a conversation and the ability for us to provide the service as a whole. Because of how Discord works, content is sent to other users, and those users rely on having access to that content. If a given text channel were suddenly missing important context, it would be confusing to other users or possibly mislead those users about what happened in that conversation.
…
Your Data Package should help you identify any messages, images, or files that you would like deleted in spaces that you currently cannot access. If you provide us with a list of the Message IDs and the corresponding channel IDs that contain personal information, we will gladly work to delete the messages you identify.
Who’s going to be the first to send them about a million message IDs?
Data is valuable. It took ages for Discord to offer ability to delete posts when you ban an user and last time I used Discord it was still limited to the recent posts. They also doesn’t comply with GDPR requests unless you threaten to file official complaint with Data Protection Authority.
And with their AI bot coming that’s gonna scrape every single message sent it’s not suprising they want to keep as much data as possible to be able to train their model.
This has always been one of my pet peeves in Discord, along with intense resource usage.
IIRC discord also doesn’t delete images from your local when the image message was deleted, so if someone sent you an image and they decide to delete it you still have a copy of it in your disk.
Undiscord is wonderful. I used it for the servers I had access to. I will say that their delete profile has gotten ever so slightly better. It now doesn’t tie a unique username or ID to the deleted user. It’s obvious in small servers or DMs but it’s much harder to figure out who sent what if a server has more than one deleted member.
Now I only use a fresh discord to voice chat under an alias email and fake phone number. Matrix for friends that agree to join.
Scumbag company
This is why you shouldn’t trust closed source software. There are alternatives such as Matrix; Mumble; Wire; Jami; etc.
https://alternativeto.net/software/discord-app/?license=opensource