Documentation API

This commit is contained in:
AliasAlreadyTaken 2022-03-02 09:16:48 +01:00
parent c3f9351266
commit 3c9dba1a5d
1 changed files with 17 additions and 0 deletions

View File

@ -68,6 +68,23 @@ function yl_matterbridge.receive_from_bridge(user_name, message_text)
end
```
Overwrite this function instead if you want to use other fields coming from the bridge.
```
function yl_matterbridge.receive_all_from_bridge(dataset)
if dataset.username and dataset.text and dataset.account then
local user_name = dataset.username
local message_text = dataset.text
local account_name = dataset.account
yl_matterbridge.receive_from_bridge(user_name, message_text, account_name)
else
core.log(
"error",
"[MOD] yl_matterbridge: receive/http.fetch failed. No dataset in returned data = " .. dump(dataset)
)
end
end
```
Call this function to send something to the bridge
```
function yl_matterbridge.send_to_bridge(user_name, message_text)