I have migrated from IRC to various Discords these days and started to wonder if I still have any use for the mIRCStats license I bought years ago. Turns out, I do. I found a nifty little Discord bot on GitHub called StatBot, by MJHeijster. It saves Discord logs to a format that can be parsed by mIRCStats. You can do individual channels, or whole server if you want to. Or you can keep the bot at a rank that doesn’t have access to all channels, if you want to keep some discussions private.
I run the bot on a Windows Server 2012 R2, just so it isn’t tied up to my own uptime. Obviously you can just run it on a normal Windows PC as well. I have set scheduled tasks to run mIRCStats every hour and then move the necessary files over with pscp to my Ubuntu server. The results can be found on https://darkball.net/stats/zybez.html. It works fantastically!