Send a plaintext message to a room.
* This will automatically make the client join the room so they can send the * message if they are not already joined. It will also make sure that the client * has sufficient power level to do this. * @param roomId The room to send to. * @param text The text string to send. */ sendText(roomId: string, text: string): Promise<{ event_id: string; }>; /** *Set the name of a room.
* This will automatically make the client join the room so they can set the * name if they are not already joined. It will also make sure that the client * has sufficient power level to do this. * @param roomId The room to send to. * @param name The room name. */ setRoomName(roomId: string, name: string): Promise<{ event_id: string; }>; /** *Set the topic of a room.
* This will automatically make the client join the room so they can set the * topic if they are not already joined. It will also make sure that the client * has sufficient power level to do this. * @param roomId The room to send to. * @param topic The room topic. */ setRoomTopic(roomId: string, topic: string): Promise<{ event_id: string; }>; /** *Set the avatar of a room.
* This will automatically make the client join the room so they can set the * topic if they are not already joined. It will also make sure that the client * has sufficient power level to do this. * @param roomId The room to send to. * @param avatar The url of the avatar. * @param info Extra information about the image. See m.room.avatar for details. */ setRoomAvatar(roomId: string, avatar: string, info?: string): Promise<{ event_id: string; }>; /** *Send a typing event to a room.
* This will automatically make the client join the room so they can send the * typing event if they are not already joined. * @param roomId The room to send to. * @param isTyping True if typing */ sendTyping(roomId: string, isTyping: boolean): PromiseSend a read receipt to a room.
* This will automatically make the client join the room so they can send the * receipt event if they are not already joined. * @param roomId The room to send to. * @param eventId The event ID to set the receipt mark to. */ sendReadReceipt(roomId: string, eventId: string): PromiseSend an m.room.message event to a room.
Send a message event to a room.
* This will automatically make the client join the room so they can send the * message if they are not already joined. It will also make sure that the client * has sufficient power level to do this. * @param roomId The room to send to. * @param type The event type * @param content The event content */ sendEvent(roomId: string, type: string, content: RecordSend a state event to a room.
* This will automatically make the client join the room so they can send the * state if they are not already joined. It will also make sure that the client * has sufficient power level to do this. * @param roomId The room to send to. * @param type The event type * @param skey The state key * @param content The event content */ sendStateEvent(roomId: string, type: string, skey: string, content: RecordGet the current room state for a room.
* This will automatically make the client join the room so they can get the * state if they are not already joined. * @param roomId The room to get the state from. * @param useCache Should the request attempt to lookup * state from the cache. */ roomState(roomId: string, useCache?: boolean): PromiseInvite a user to a room.
* This will automatically make the client join the room so they can send the * invite if they are not already joined. * @param roomId The room to invite the user to. * @param target The user ID to invite. * @return Resolved when invited, else rejected with an error. */ invite(roomId: string, target: string): PromiseKick a user from a room.
* This will automatically make the client join the room so they can send the * kick if they are not already joined. * @param roomId The room to kick the user from. * @param target The target of the kick operation. * @param reason Optional. The reason for the kick. * @return Resolved when kickked, else rejected with an error. */ kick(roomId: string, target: string, reason?: string): PromiseBan a user from a room.
* This will automatically make the client join the room so they can send the * ban if they are not already joined. * @param roomId The room to ban the user from. * @param target The target of the ban operation. * @param reason Optional. The reason for the ban. * @return Resolved when banned, else rejected with an error. */ ban(roomId: string, target: string, reason?: string): PromiseUnban a user from a room.
* This will automatically make the client join the room so they can send the * unban if they are not already joined. * @param roomId The room to unban the user from. * @param target The target of the unban operation. * @return Resolved when unbanned, else rejected with an error. */ unban(roomId: string, target: string): PromiseJoin a room
* This will automatically send an invite from the bot if it is an invite-only * room, which may make the bot attempt to join the room if it isn't already. * @param roomIdOrAlias The room ID or room alias to join. * @param viaServers The server names to try and join through in * addition to those that are automatically chosen. */ join(roomIdOrAlias: string, viaServers?: string[]): PromiseLeave a room
* This will no-op if the user isn't in the room. * @param roomId The room to leave. * @param reason An optional string to explain why the user left the room. */ leave(roomId: string, reason?: string): PromiseGet a user's profile information
* @param userId The ID of the user whose profile to return * @param info The profile field name to retrieve (e.g. 'displayname' * or 'avatar_url'), or null to fetch the entire profile information. * @param useCache Should the request attempt to lookup * state from the cache. * @return A Promise that resolves with the requested user's profile * information */ getProfileInfo(userId: string, info?: UserProfileKeys, useCache?: boolean): PromiseSet the user's display name
* @param name The new display name */ setDisplayName(name: string): PromiseSet the user's avatar URL
* @param url The new avatar URL */ setAvatarUrl(url: string): Promise