def room_check(func):
    """Decorator to check if the client has set a room or not."""

    def wrapped(self, *args, **kwargs):
        if not self.room:
            raise RuntimeError("You must set a room to use by calling set_room method firstly")
        r = func(self, *args, **kwargs)
        return r

    return wrapped