Quick and dirty Python 3.8 script to save all private messages from a Discord user account to local files. It saves the last point where messages were downloaded to allow repeat runs without hitting the Discord API unnecessarily.
Google elsewhere.
This is not tested on any platform besides Linux, but I don't see any reason it shouldn't work on Windows.
Download the script and install the following libraries with pip:
pip install tzlocal unidecode requests