Discord is a closed source system. Matrix with a discord bridge would work. You just use your matrix server and a bot to send and receive on your behalf. There is functionality between but technically the two systems are independent. I also see issues with it not being 100% all the time. Typical of something bridging to a closed system.
What compatibility are you looking for? A non discord application connected directly to a discord server and can send text, audio and visual via discord infrastructure? Nah, probably won’t happen. Bridging is the closest right now.
I was able to get it working on bazzite (fedora)