13 Commits
dev ... master

Author SHA1 Message Date
0d14d149d3 更新 'package.json' 2023-02-13 16:10:06 +08:00
bde0bc7e53 更新 'src/matrix-send-message.js' 2023-02-13 15:56:39 +08:00
1f37650763 更新 'src/matrix-send-message.js' 2023-02-13 11:24:41 +08:00
0166620ef0 更新 'README.md' 2023-02-13 11:23:31 +08:00
6dcadeb8d2 更新 'package.json' 2023-02-13 11:23:16 +08:00
1a08750828 更新 'package.json' 2023-02-13 11:21:58 +08:00
8e601a88e1 更新 'README.md' 2023-02-13 11:20:59 +08:00
e0e45c6b18 更新 'src/matrix-send-message.js' 2023-02-13 11:01:20 +08:00
a336ce1beb 更新 'src/matrix-send-message.js' 2023-02-13 10:47:34 +08:00
978a039498 更新 'package.json' 2023-02-13 10:13:47 +08:00
f10fdbfab2 更新 'src/matrix-send-message.js' 2023-02-13 09:51:01 +08:00
ddfa90bd77 更新 'src/matrix-send-message.html' 2023-02-13 09:27:17 +08:00
Skylar Sadlier
78f8ab7abb Merge pull request #74 from Skylar-Tech/dev
v0.7.0
2022-12-06 22:15:49 -07:00
4 changed files with 26 additions and 24 deletions

View File

@@ -1,9 +1,6 @@
# node-red-contrib-matrix-chat
# node-red-contrib-matrix-chat-jw
[Matrix](https://matrix.org/) chat server client for [Node-RED](https://nodered.org/)
***Currently we are in beta. We ask that you open any issues you have on our repository to help us reach a stable well tested version. Things may change & break before our first release so check changelog before updating.***
If you need help with this feel free to join our public matrix room at [#node-red-contrib-matrix-chat:skylar.tech](https://app.element.io/#/room/#node-red-contrib-matrix-chat:skylar.tech)
### Features
@@ -36,16 +33,12 @@ Therefore, you can easily build a bot, chat relay, or administrate your Matrix s
You can either install from within Node-RED by searching for `node-red-contrib-matrix-chat` or run this from within your Node-RED directory:
```bash
npm install node-red-contrib-matrix-chat
npm install node-red-contrib-matrix-chat-jw
```
### Usage
We have examples! [Check them out](https://github.com/Skylar-Tech/node-red-contrib-matrix-chat/tree/master/examples#readme)
#### Extra functionality
You are not limited by just the nodes we have created. If you turn on global access when setting up your Matrix Client you can access the client directly from any function node to write your own logic.
View an example [here](https://github.com/Skylar-Tech/node-red-contrib-matrix-chat/tree/master/examples#use-function-node-to-run-any-command)
### End-to-End Encryption Notes
Currently, this module has no way of getting encryption keys from other devices on the same account. Therefore it is recommended you use the bot exclusively with Node-RED after it's creation. Failure to do so will lead to your bot being unable to receive messages from e2ee rooms it joined from another client. Shared secret registration makes this super easy since it returns a token and device ID.
@@ -57,15 +50,5 @@ Want to contribute? Any help on getting the last pieces of e2ee figured out woul
### Generate user
You will need a user to use this module. Luckily this module comes with a node that allows you to register users to a homeserver using the secret registration endpoint. This is perfect because it returns an `access_token` as well as a `device_id` which is exactly what we need.
[Click here](https://github.com/Skylar-Tech/node-red-contrib-matrix-chat/tree/master/examples#readme) to see how to generate a user using secret registration
### Other Packages
- [node-red-contrib-gamedig](https://www.npmjs.com/package/node-red-contrib-gamedig) - Query game servers from Node-RED!
### Contributing
All contributions are welcome! If you do add a feature please do a pull request so that everyone benefits :)
Sharing is caring!

View File

@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-matrix-chat",
"version": "0.7.0",
"name": "node-red-contrib-matrix-chat-jw",
"version": "0.7.3",
"description": "Matrix chat server client for Node-RED",
"dependencies": {
"abort-controller": "^3.0.0",
@@ -53,11 +53,11 @@
],
"repository": {
"type": "git",
"url": "https://github.com/skylar-tech/node-red-contrib-matrix-chat"
"url": "https://git-x.kongjian.xin/Matrix/node-red-contrib-matrix-chat"
},
"author": {
"name": "Skylar Sadlier",
"url": "https://skylar.tech"
"name": "jingweiht",
"url": "https://jingweiht.com"
},
"license": "SEE LICENSE FILE"
}

View File

@@ -62,6 +62,8 @@
<select id="node-input-messageType">
<option value="m.text">m.text</option>
<option value="m.notice">m.notice</option>
<option value="m.location">m.location</option>
<option value="m.live">m.live</option>
<option value="msg.type">msg.type input</option>
</select>
</div>

View File

@@ -113,6 +113,23 @@ module.exports = function(RED) {
body: payload.toString()
};
//zhongjin
if (msgType === 'm.location') {
content.body = '长沙火车站, 车站中路, 五里牌街道, 芙蓉区, 长沙市, 湖南省, 410001, 中国';
content.geo_uri = "geo:28.1974439,113.0054238";
}
if (msgType === 'm.live') {
msg.topic = "org.matrix.msc3672.beacon_info";
content.body = "Live location";
content.timeout= 3600000;
content.live = true;
}
//end
if(msgFormat === 'html') {
content.format = "org.matrix.custom.html";
content.formatted_body =