This far been a solved problem for 30 years. You just run an IRC bouncer on a host that's always up (like on a VPS) and have your IRC client connect to that. The bouncer will keep scrollback and logs for you.
Of course if you use Discord you don't need to bother to do any of that, so the convenience it offers is real, but it's not like if you're an IRC user you can't have persistent history.
On the other hand, with IRC you only log the channels you're in (unless you run your own IRC server), so you will miss out on history from other channels.