Perform PUT /rooms/$room_id/state/m.room.topic
        Args:
            room_id (str): The room ID
            topic (str): The new room topic
            timestamp (int): Set origin_server_ts (For application services only)
357802
def set_room_topic(self, room_id, topic, timestamp=None):
        
        body = {
            "topic": topic
        }
        return self.send_state_event(room_id, "m.room.topic", body, timestamp=timestamp)
36735
function sendToRoom(content, room) {
    return getRoomId(room)
        .then((roomId) => sendToRoomId(content, roomId));
}
90576
public void setId(final String id) {
        // Set the DBId as well if it isn't a new id
        if (id.matches(CSConstants.EXISTING_TOPIC_ID_REGEX)) {
            DBId = Integer.parseInt(id);
        }
        this.id = id;
    }
473933
def update_aliases(self):
        
        changed = False
        try:
            response = self.client.api.get_room_state(self.room_id)
        except MatrixRequestError:
            return False
        for chunk in response:
            content = chunk.get('content')
            if content:
                if 'aliases' in content:
                    aliases = content['aliases']
                    if aliases != self.aliases:
                        self.aliases = aliases
                        changed = True
                if chunk.get('type') == 'm.room.canonical_alias':
                    canonical_alias = content['alias']
                    if self.canonical_alias != canonical_alias:
                        self.canonical_alias = canonical_alias
                        changed = True
        if changed and self.aliases and not self.canonical_alias:
            self.canonical_alias = self.aliases[0]
        return changed
92551
def update_room_topic(self):
        """"""
        try:
            response = self.client.api.get_room_topic(self.room_id)
            if "topic" in response and response["topic"] != self.topic:
                self.topic = response["topic"]
                return True
            else:
                return False
        except MatrixRequestError:
            return False
892700
def topic(id, options={})
      params = { :lang => @query_options[:lang], :limit => @query_options[:limit] }.merge(options)
      get(surl('topic') + id, params, format: :json).parsed_response
    end
844221
public function setTopic($topic)
    {
        $queryParams = array(
            'topic' => $topic,
        );
        $room_id_or_name = $this->getId();

        $response = $this->request->put('room/'.$room_id_or_name.'/topic', $queryParams);

        return $this->request->returnResponseObject($response);
    }
1353379
def groups_set_description(self, room_id, description, **kwargs):
        """"""
        return self.__call_api_post('groups.setDescription', roomId=room_id, description=description, kwargs=kwargs)
843757
def publishToRoom(self, roomId, name, data, userList=None):
        
        if userList is None:
            userList = self.getRoom(roomId)

        # Publish data to all room users
        logging.debug("%s: broadcasting (name: %s, data: %s, number of users: %s)" % (self._gcls(), name, data, len(userList)))
        self.broadcast(userList, {
            "name": name,
            "data": SockJSRoomHandler._parser.encode(data)
        })
1324930
def send_message(self, message, room_id, **kwargs):
        
        return SendMessage(settings=self.settings, **kwargs).call(
            message=message,
            room_id=room_id,
            **kwargs
        )
229793
function prepareMessage(content, roomId) {
    const message = new message_1.Message(content, exports.integrationId);
    if (roomId)
        message.setRoomId(roomId);
    return message;
}
204616
def rooms_favorite(self, room_id=None, room_name=None, favorite=True):
        """"""
        if room_id is not None:
            return self.__call_api_post('rooms.favorite', roomId=room_id, favorite=favorite)
        elif room_name is not None:
            return self.__call_api_post('rooms.favorite', roomName=room_name, favorite=favorite)
        else:
            raise RocketMissingParamException('roomId or roomName required')
1072122
def groups_set_topic(self, room_id, topic, **kwargs):
        """"""
        return self.__call_api_post('groups.setTopic', roomId=room_id, topic=topic, kwargs=kwargs)
276888
def channels_set_type(self, room_id, a_type, **kwargs):
        """"""
        return self.__call_api_post('channels.setType', roomId=room_id, type=a_type, kwargs=kwargs)
1267365
public JSONObject updateRoomSettings(String company, String roomId, String username, HashMap<String, String> params) throws JSONException {
        return oClient.put("/messages/v3/" + company + "/rooms/" + roomId + "/users/" + username, params);
    }
988457
def typing(self, room: Room, timeout: int = 5000):
        
        path = f'/rooms/{quote(room.room_id)}/typing/{quote(self.user_id)}'
        return self.api._send('PUT', path, {'typing': True, 'timeout': timeout})
326204
function() {
            self._client.roomState(roomId).then(function(events) {
                events.forEach(function(ev) {
                    if (self._eventTypes[ev.type]) {
                        if (!r.events[ev.type]) {
                            r.events[ev.type] = {};
                        }
                        r.events[ev.type][ev.state_key] = ev;
                    }
                });
                resolve(r);
            }, function(err) {
                if (err.httpStatus >= 400 && err.httpStatus < 600) { // 4xx, 5xx
                    reject(err); // don't have permission, don't retry.
                }
                // wait a bit then try again
                Promise.delay(3000).then(function() {
                    if (!self._dict[roomId]) {
                        return;
                    }

                    queryRoomState();
                });
            });
        }