Documentation API
This commit is contained in:
parent
c3f9351266
commit
3c9dba1a5d
17
README.md
17
README.md
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue