> Opensource Discord, Self-hosted, federated
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.
Matrix is slow, buggy trash with bad clients.
(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.)