I think of Matrix as a protocol + client/server suite; an open standard with official software backing it and a number of parallel implementations. When I wanted to stand up an independent server that could do most of what Discord does for communities, Matrix was the easy find. Encrypted chat, e2e support, and encrypted voice and video chat rooms with screen share.
I admit I didn't research "XMPP-based discord alternative" but maybe that says something about the ecosystem's health.