code: def set_join_rule(self, room_id, join_rule):
          
          content = {
              "join_rule": join_rule
          }
          return self.send_state_event(room_id, "m.room.join_rules", content)
docs: Set the rule for users wishing to join the room.
  
          Args:
              room_id(str): The room to set the rules for.
              join_rule(str): The chosen rule. One of: ["public", "knock",
                  "invite", "private"]