Bugfix send_to_bridgeg ins in yl_matterbridge
This commit is contained in:
parent
bc6092b6e2
commit
c101e77b4f
10
init.lua
10
init.lua
@ -21,7 +21,8 @@ yl_matterbridge.information.version = "0.0.2"
|
|||||||
yl_matterbridge.information.author = "AliasAlreadyTaken"
|
yl_matterbridge.information.author = "AliasAlreadyTaken"
|
||||||
yl_matterbridge.information.license = "MIT"
|
yl_matterbridge.information.license = "MIT"
|
||||||
yl_matterbridge.information.name = "yl_matterbridge"
|
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 address = core.settings:get("yl_matterbridge.address") or "127.0.0.1"
|
||||||
local port = core.settings:get("yl_matterbridge.port") or "4242"
|
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)
|
function send(user_name, message_text)
|
||||||
local url = "http://" .. address .. ":" .. port .. "/api/message"
|
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 timeout = 10
|
||||||
local data = {
|
local data = {
|
||||||
text = message_text,
|
text = message_text,
|
||||||
@ -97,10 +98,11 @@ function yl_matterbridge.send_to_bridge(user_name, message_text)
|
|||||||
send(user_name, message_text)
|
send(user_name, message_text)
|
||||||
end
|
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)
|
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
|
end
|
||||||
|
|
||||||
-- connect to Minetest
|
-- connect to Minetest
|
||||||
|
Loading…
Reference in New Issue
Block a user