Send /me output to IRC

This commit is contained in:
LoneWolfHT 2021-03-18 17:45:11 -07:00 committed by GitHub
parent 92104db90f
commit e9f09c3587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -272,6 +272,8 @@ minetest.register_chatcommand("t", {
end
})
local function me_func() end
if minetest.global_exists("irc") then
function irc.playerMessage(name, message)
local color = ctf_colors.get_irc_color(ctf.player(name))
@ -286,6 +288,14 @@ if minetest.global_exists("irc") then
local bbrace = color .. ">" .. clear
return ("%s%s%s %s"):format(abrace, name, bbrace, message)
end
me_func = function(...)
local message = irc.playerMessage(...)
message = "*" .. message:sub(message:find(" "))
irc.say(message)
end
end
local handler
@ -319,6 +329,7 @@ minetest.registered_chatcommands["me"].func = function(name, param)
else
name = "* ".. name
end
me_func(name, param)
minetest.chat_send_all(name .. " " .. param)
end