Sounds like you want https://matrix.org/
> Discord is a good design
Then the main, reference client https://element.io/ or https://fluffy.chat would work great for you.
... With the only caveat being that general experience of using Matrix is awful.
I second the other commenter's suggestion of using https://stoat.chat/ or as it used to be called: Revolt, which matches the "Opensource Discord" requirement perfectly.
(Incidentally, this is also the incantation that will cause its primary maintainer to show up in the comment thread and tell me that I’m not using their seemingly annual complete new client rewrite that fixes all of the problems and makes it perfect now.)
Soatok covered it very well here: https://soatok.blog/2024/08/14/security-issues-in-matrixs-ol...
I'm quite sure most of these issues were fixed by now, but the fundamental issues remain, at least in this federation.
Nobody scales free, high-bandwidth services without some dark money support from feds or worse.