node-red-contrib-matrix-cha.../examples
Skylar Sadlier 6a310de708 Closes #21
- Can now access the matrix client globally so it can be used in function nodes (this way you are not limited by only the nodes we have published)
- Added example for using the Matrix Client in a function to redact messages. This should be a great example to show people what is possible.
2021-09-03 08:24:02 -06:00
..
add-user-with-admin-user.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
add-user-with-admin-user.png - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
custom-redact-function-node.json Closes #21 2021-09-03 08:24:02 -06:00
custom-redact-function-node.png Closes #21 2021-09-03 08:24:02 -06:00
README.md Closes #21 2021-09-03 08:24:02 -06:00
respond-file-with-file.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
respond-file-with-file.png Added some examples 2021-08-18 14:19:20 -06:00
respond-image-with-image.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
respond-image-with-image.png Added some examples 2021-08-18 14:19:20 -06:00
respond-ping-pong.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
respond-ping-pong.png Added some examples 2021-08-18 14:19:20 -06:00
respond-react-with-reaction.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
respond-react-with-reaction.png Added some examples 2021-08-18 14:19:20 -06:00
respond-to-html-with-html.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
respond-to-html-with-html.png Added some examples 2021-08-18 14:19:20 -06:00
respond-users-list.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
respond-users-list.png Added some examples 2021-08-18 14:19:20 -06:00
shared-secret-registration.json - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00
shared-secret-registration.png - Fixed not being able to disable e2ee 2021-08-30 19:21:02 -06:00

Examples

These are examples of what is possible with the node-red-contrib-matrix-chat module for Node-RED

If you want to try any of them out just copy their JSON contents from their .json file and use the hamburger menu in Node-RED to import the flow.

Build something cool with these nodes? Feel free to submit a pull request to share it!

Index

Create user with Shared Secret Registration

View JSON

Use this flow to create users on servers with closed registration. You also use this endpoint to create your first admin user as it is the same as running the local python script on the server. This requires your registration secret from your homeserver.yaml Synapse server configuration file.

Edit the object on the inject node to the user/pass combo you want to create and hit the inject button (to the left of the inject node).

Note: This only works on Synapse servers.

img.png

Create/Edit Synapse User

View JSON

Allows an administrator to create or modify a user account with a specified msg.userId.

img.png

Use function node to run any command

View JSON

If we do not have a node for something you want to do (such as redacting events/messages) you can do this manually with a function node.

Note: You should make sure to catch any errors in your function node otherwise you could cause Node-RED to crash.

To view what sort of functions you have access to check out the client.ts file from matrix-js-sdk here.

img.png

Respond to "ping" with "pong"

View JSON

Use this flow to respond to anyone that says "ping" with "pong" into the same room.

img.png

Respond to "html" with an HTML message

View JSON

Use this flow to respond to anyone that says "html" with an example HTML message. This shows how easy it is to send HTML.

img.png

Respond to "image" with an uploaded image

View JSON

You will need an image on the machine running Node-RED. In this case example.png exists inside the Node-RED directory.

img_1.png

Respond to "file" with an uploaded file

View JSON

You will need a file on the machine running Node-RED. In this case sample.pdf exists inside the Node-RED directory.

img.png

Respond to "react" with a reaction

View JSON

Give a 👍 reaction when someone says "react"

img.png

Respond to "users" with full list of server users

View JSON

When someone sends the text "users" they get a HTML message back containing all the current users on the server.

This requires admin privileges.

img.png