Class: AppServiceBot

AppServiceBot(client, registration, memberCache)

new AppServiceBot(client, registration, memberCache)

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.
memberCache MembershipCache The bridges membership cache instance, for storing membership the bot has discovered.
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()

Deprecated:
  • Yes
Source:
Throws:
This will always throw because /sync is no longer supported.
Type
Error

isRemoteUser() → {boolean}

Test a userId to determine if it's a user within the exclusive regexes of the bridge.
Source:
Returns:
True if it is a remote user, false otherwise.
Type
boolean

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: