This script allow for user specific message deletion from an entire server or a single channel using the browser console. This script uses discord search API and it will only delete messages of a chosen user.
Go to user settings > appearance in discord and enable Developer mode.
Open discord and right click on the server icon and click copy id. Replace the server id in the script with your server id. Do the same process for the author id by right clicking the avatar image.
Press F12 in Chrome or Firefox to open the console. Paste the modified script in the console and press enter.
The more messages the longer it takes. You can check if the messages have been deleted by using the search.
I think there are some channels that this script won't work with. I think they may be NSFW channels but I haven't tested enough.
Use this script at your own risk
This script was based on the following scripts https://gist.github.com/niahoo/c99284a8908cd33d59b4aff802179e9b#gistcomment-2397287 https://gist.github.com/IMcPwn/0c838a6248772c6fea1339ddad503cce
How exactly can this work in a DM?
Open discord and right click on the server icon and click copy id. Replace the server id in the script with your server id. Do the same process for the author id by right clicking the avatar image.