Room

Join a room

client.joinRoomById(id);

Input Parameters:

Name
Type
Description
Required

roomId

String

Room_id string

true

Create a room

 Future<String> createRoom(
      {Map<String, Object?>? creationContent,
      List<StateEvent>? initialState,
      List<String>? invite,
      List<Invite3pid>? invite3pid,
      bool? isDirect,
      String? name,
      Map<String, Object?>? powerLevelContentOverride,
      CreateRoomPreset? preset,
      String? roomAliasName,
      String? roomVersion,
      String? topic,
      Visibility? visibility})

Create DM

Invite user to a room

Input Parameters:

Name
Type
Description
Required

userID

String

user ID

true

Get room information

Input Parameters:

Name
Type
Description
Required

filter

String

filter string

false

since

String

since string

false

fullState

bool

fullState bool

false

setPresence

PresenceType

setPresence PresenceType

false

timeout

String

timeout int

false

Leave a room

Modify room name

Input Parameters:

Name
Type
Description
Required

newName

String

room name

true

Modify room type

Input parameters:

Name
Type
Description
Required

roomid

string

Roomid string

true

eventType

string

The type of event to send

true

stateKey

string

The state_key for the state to send.

false

body

map

JSON data

true

Example

JSON structure

The JSON data has the following structure:

Explanation of Fields

  • join_rule: This field specifies the rule for joining a room.

    • token.access: This rule allows only users with the required tokens to enter the room.

    • token.message: With this rule, all users are permitted to enter the room and view messages. However, only users who meet certain requirements can send messages within the room.

  • join_params: This section contains additional parameters for controlling room access.

    • logic: It specifies whether users need to meet just one of the specified requirements (ANY) or all of them (ALL) in order to gain access to the room.

    • Require: An array of objects specifying the required tokens and their associated criteria for access. You can configure at most five requirements.

      • required token: Details of the token that is required for access. This includes:

        • name: The name of the token.

        • symbol: The symbol of the token.

        • logo: URL to the logo image of the token.

        • address: The contract address of the token.

        • requiredAmount: Specifies the minimum required amount of the token for access.

Last updated