sender: Refactor into a new type
Instead of passing strings and rooms to a function, you can create the new type with a string in it, and the sort of message to send. After that, this message can be sent with a method that takes the room and event to respond to.
This will help to make things more testable.