Added temporary logging
This commit is contained in:
parent
a599cc886f
commit
0bb3872efe
4
init.lua
4
init.lua
|
@ -54,6 +54,7 @@ function send(user_name, message_text)
|
|||
function(result)
|
||||
if result.succeeded then
|
||||
local data = core.parse_json(result.data)
|
||||
core.log("action", "[MOD] yl_matterbridge : Posted " .. dump(data))
|
||||
else
|
||||
core.log("error", "[MOD] yl_matterbridge: send/http.fetch failed. Result = " .. dump(result))
|
||||
return false
|
||||
|
@ -77,6 +78,7 @@ local function receive()
|
|||
local data = core.parse_json(result.data)
|
||||
for _, v in ipairs(data) do
|
||||
if v.username and v.text then
|
||||
core.log("action", "[MOD] yl_matterbridge : Received " .. dump(data))
|
||||
yl_matterbridge.receive_from_bridge(v.username, v.text)
|
||||
end
|
||||
end
|
||||
|
@ -93,7 +95,7 @@ end
|
|||
-- Don't forget to add an optional dependency to yl_matterbridge
|
||||
|
||||
function yl_matterbridge.receive_from_bridge(user_name, message_text)
|
||||
core.chat_send_all("<" .. user_name .. "@irc> " .. message_text)
|
||||
core.chat_send_all("<<" .. user_name .. ">> " .. message_text)
|
||||
end
|
||||
|
||||
function yl_matterbridge.send_to_bridge(user_name, message_text)
|
||||
|
|
Loading…
Reference in New Issue