The bot sdk intent which this intent wraps fulfilled e.g. the entity joining the room when you call intent.join(roomId).
The client instance for the AS bot itself. This will be used to perform more priveleged actions such as creating new rooms, sending invites, etc.
Options for this Intent instance.
Readonly
botThe bot sdk intent which this intent wraps fulfilled e.g. the entity joining the room when you call intent.join(roomId).
Protected
optsOptional
dontOptional
dontOptional
getOptional
onOptional
registered?: booleanProtected
_ensureEnsures that the client has the required power level to post the event type.
If found, the power level event
Required as power levels exist inside a room.
Are we checking for state permissions or regular event permissions.
Protected
_ensureProtected
_joinBan 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.
Resolved when banned, else rejected with an error.
The room to ban the user from.
The target of the ban operation.
Optional
reason: stringOptional. The reason for the ban.
Create a room with a set of options.
Options.
Create a widget in a room.
An eventID if the event was created.
The room to create the widget in.
The widget ID
Options for the widget.
Ensure that the user has the given profile information set. If it does not, set it.
Optional
displayname: stringThe displayname to set. Leave undefined to ignore.
Optional
avatarUrl: stringThe avatar to set. Leave undefined to ignore.
Create a widget in a room, if one doesn't already exist
An eventID if the event was created, otherwise null.
The room to create the widget in.
The widget ID
Options for the widget.
Get an event in a room. This will automatically make the client join the room so they can get the event if they are not already joined.
Resolves with the content of the event, or rejects if not found.
The room to fetch the event from.
The eventId of the event to fetch.
Should the request attempt to lookup from the cache.
Get a user's profile information
A Promise that resolves with the requested user's profile information
The ID of the user whose profile to return
The profile field name to retrieve (e.g. 'displayname' or 'avatar_url'), or null to fetch the entire profile information.
Should the request attempt to lookup state from the cache.
Get a state event in a room. This will automatically make the client join the room so they can get the state if they are not already joined.
The room to get the state from.
The event type to fetch.
The state key of the event to fetch.
Return null on not found, rather than throwing
Invite 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.
Resolved when invited, else rejected with an error.
The room to invite the user to.
The user ID to invite.
Join 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.
The room ID or room alias to join.
Optional
viaServers: string[]The server names to try and join through in addition to those that are automatically chosen.
Kick 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.
Resolved when kickked, else rejected with an error.
The room to kick the user from.
The target of the kick operation.
Optional
reason: stringOptional. The reason for the kick.
Inform this Intent class of an incoming event. Various optimisations will be done if this is provided. For example, a /join request won't be sent out if it knows you've already been joined to the room. This function does nothing if a backing store was provided to the Intent.
The incoming event JSON
Resolve a roomId or alias into a roomId. If a roomId is given, it is immediately returned.
If the provided string was incorrectly formatted or alias does not exist.
A roomId or alias to resolve.
Get 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.
The room to get the state from.
Should the request attempt to lookup state from the cache.
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.
The event ID wrapped inside an object (for legacy reasons)
The room to send to.
The event type
The event content
Send an m.room.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.
The eventId of the sent message
The room to send to.
The event content
Send 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.
The room to send to.
The event ID to set the receipt mark to.
Send 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.
The event ID wrapped inside an object (for legacy reasons)
The room to send to.
The event type
The state key
The event content
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.
The Matrix event ID.
The room to send to.
The text string to send.
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.
The room to send to.
True if typing
Set the power level of the given target.
The room to set the power level in.
The target user ID
The desired level. Undefined will remove the users custom power level.
Set the presence of this user.
Resolves if the presence was set or no-oped, rejects otherwise.
One of "online", "offline" or "unavailable".
Optional
statusMsg: stringSet 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.
The room to send to.
The url of the avatar.
Optional
info: stringExtra information about the image. See m.room.avatar for details.
Set the visibility of a room in the appservice's room directory.
This only works if you have defined the protocol
in the registration file.
The room
The network (not protocol) that owns this room. E.g. "freenode" (for an IRC bridge)
Should the room be visible
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.
The Matrix event ID.
The room to send to.
The room name.
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.
The room to send to.
The room topic.
Unban 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.
Resolved when unbanned, else rejected with an error.
The room to unban the user from.
The target of the unban operation.
Signals that an error occured while handling an event by the bridge.
Warning: This function is unstable and is likely to change pending the outcome of https://github.com/matrix-org/matrix-doc/pull/2162.
ID of the room in which the error occured.
ID of the event for which the error occured.
Name of the bridged network.
The reason why the bridge error occured.
Array of regex matching all affected users.
Upload a file to the homeserver.
A MXC URL pointing to the uploaded data.
The file contents
Additional options for the upload.
Generated using TypeDoc
Create an entity which can fulfil the intent of a given user.