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
I've created a modified version of the above script which pays attention to the server error that indicates we're being rate limited, and which pauses for a bit. It still has issues, in particular it doesn't handle the failure to delete a message due to it being archived.
It works for me. As before, this comes with zero warranty, use at your own risk!
Edited to add: when deleting many messages from the same channel it's common to see 'try again later' values higher than 7000 ms. But, often many messages can be deleted in a row without being rate limited
Edited again: modified to print an URL to archived messages, to more easily track them down.