diff --git a/init.lua b/init.lua index c7ede7c..1559509 100644 --- a/init.lua +++ b/init.lua @@ -21,7 +21,8 @@ yl_matterbridge.information.version = "0.0.2" yl_matterbridge.information.author = "AliasAlreadyTaken" yl_matterbridge.information.license = "MIT" yl_matterbridge.information.name = "yl_matterbridge" -yl_matterbridge.information.additional = "Sends and receives ingame chat to and from matterbridge https://github.com/42wim/matterbridge" +yl_matterbridge.information.additional = + "Sends and receives ingame chat to and from matterbridge https://github.com/42wim/matterbridge" local address = core.settings:get("yl_matterbridge.address") or "127.0.0.1" local port = core.settings:get("yl_matterbridge.port") or "4242" @@ -32,7 +33,7 @@ local http = core.request_http_api() function send(user_name, message_text) local url = "http://" .. address .. ":" .. port .. "/api/message" - local post_headers = {"Content-Type: application/json"} + local post_headers = {"Content-Type: application/json, "} local timeout = 10 local data = { text = message_text, @@ -97,10 +98,11 @@ function yl_matterbridge.send_to_bridge(user_name, message_text) send(user_name, message_text) end --- Set this function to yl_matterbridge.chat_message = function() end if you call yl_matterbridge.send_to_bridge yourself +-- Set this function to yl_matterbridge.chat_message = function() end +-- if you call yl_matterbridge.send_to_bridge yourself function yl_matterbridge.chat_message(user_name, message_text) - send_to_bridge(user_name, message_text) + yl_matterbridge.send_to_bridge(user_name, message_text) end -- connect to Minetest