Room
JavaScript Room APIs
Create a chat room
Name | Parameters Description | Response |
---|---|---|
| Please refer to the table below. | N/A |
Name | Type | Description |
---|---|---|
|
| Extra keys, such as |
|
| A list of state events to set in the new room. This allows the user to override the default state events set in the new room. The expected format of the state events are an object with type, state_key and content keys set. Takes precedence over events set by |
|
| A list of user IDs to invite to the room. This will tell the server to invite everyone in the list to the newly created room. |
|
| If this is included, an |
|
|
Convenience parameter for setting various default state events based on a preset. If unspecified, the server should use the One of: |
|
|
The desired room alias local part. If this is included, a room alias will be created and mapped to the newly created room. The alias will belong to the same node which created the room. For example, if this was set to “foo” and sent to the node “example.com” the complete room alias would be The complete room alias will become the canonical alias for the room and an |
|
| If this is included, an |
|
| A One of: |
Name | Type | Description |
---|---|---|
|
| The content of the event. |
|
| The state_key of the state event. Defaults to an empty string. |
|
| The type of event to send. |
Query DM room by User ID
Name | Parameters Description | Response |
---|---|---|
|
| dm_rooms: room Id array |
Join a chat room
Name | Parameters Description | Response |
---|---|---|
| roomIdOrAlias: The room identifier or alias to join. | N/A |
Leave the chat room
Name | Parameters Description | Response |
---|---|---|
| roomId: room id callback (optional): | N/A |
Invite user to the room
Name | Parameters Description | Response |
---|---|---|
| roomId: room id userId: user id callback (optional): | N/A |
Revoke invitation
Name | Parameters Description | Response |
---|---|---|
| roomId: room ID; userId: user id;reason(optional): string; callback(optional): function | N/A |
Remove user from a room
Remove the user from the room.
Name | Parameters Description | Response |
---|---|---|
| roomId: room id userId: user id reason: reason string callback (optional): | N/A |
Ban user from a room
As the room owner, you can ban users, effectively removing them from the room and preventing their re-entry.
Name | Parameters Description | Response |
---|---|---|
| roomId: room id userId: user id reason: reason string callback (optional): | N/A |
Modify the user's own nickname in a room
Name | Parameters Description | Response |
---|---|---|
| roomId: room id userId: user id membershipValue: nickName: new nickname | N/A |
Modify room name
Name | Parameters Description | Response |
---|---|---|
| roomId: room id name: new room name callback (optional): | event_id |
Delete room
Name | Parameters Description | Response |
---|---|---|
| roomId: room ID | N/A |
Last updated