Bugfix send_to_bridgeg ins in yl_matterbridge

This commit is contained in:
AliasAlreadyTaken 2022-02-25 23:23:03 +01:00
parent bc6092b6e2
commit c101e77b4f
1 changed files with 6 additions and 4 deletions

View File

@ -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