code: def set_guest_access(self, allow_guests):
          
          guest_access = "can_join" if allow_guests else "forbidden"
          try:
              self.client.api.set_guest_access(self.room_id, guest_access)
              self.guest_access = allow_guests
              return True
          except MatrixRequestError:
              return False
docs: Set whether guests can join the room and return True if successful.