Seems not so easy as the oss project owners I asked to do that had no idea how. That would make life better indeed.
From there it's no longer a Discord problem, as you just need to export that data somewhere. There's bots which already partialy do this. There's bots that log edits & deletes for moderators to review and bots like TicketTool (https://tickettool.xyz/) let you create special one-off channels (tickets) that you can export to html on closure too.