new AppServiceBot(client, registration)
Construct an AS bot user which has various helper methods.
Parameters:
Name | Type | Description |
---|---|---|
client |
MatrixClient | The client instance configured for the AS bot. |
registration |
AppServiceRegistration | The registration that the bot is following. Used to determine which user IDs it is controlling. |
- Source:
Methods
getJoinedMembers(roomId) → {Promise.<Object, Error>}
Get a map of joined user IDs for the given room ID. The values in the map are objects
with a 'display_name' and 'avatar_url' properties. These properties may be null.
Parameters:
Name | Type | Description |
---|---|---|
roomId |
string | The room to get a list of joined user IDs in. |
- Source:
Returns:
Resolves to a map of user ID => display_name avatar_url
- Type
- Promise.<Object, Error>
getJoinedRooms() → {Promise.<Array.<string>, Error>}
Get a list of joined room IDs for the AS bot.
- Source:
Returns:
Resolves to a list of room IDs.
- Type
- Promise.<Array.<string>, Error>
getMemberLists() → {Promise}
Get the membership lists of every room the AS bot is in. This does a /sync.
- Source:
Returns:
Resolves to a dict of room_id: AppServiceBot~RoomInfo.
- Type
- Promise
Type Definitions
RoomInfo
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
id |
string | The matrix room ID |
state |
Array.<Object> | The raw state events for this room |
realJoinedUsers |
Array.<string> | A list of user IDs of real matrix users that have joined this room. |
remoteJoinedUsers |
Array.<string> | A list of user IDs of remote users (provisioned by the AS) that have joined this room. |
- Source: