Send /me output to IRC
This commit is contained in:
parent
92104db90f
commit
e9f09c3587
1 changed files with 12 additions and 1 deletions
|
@ -272,6 +272,8 @@ minetest.register_chatcommand("t", {
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local function me_func() end
|
||||||
|
|
||||||
if minetest.global_exists("irc") then
|
if minetest.global_exists("irc") then
|
||||||
function irc.playerMessage(name, message)
|
function irc.playerMessage(name, message)
|
||||||
local color = ctf_colors.get_irc_color(ctf.player(name))
|
local color = ctf_colors.get_irc_color(ctf.player(name))
|
||||||
|
@ -286,6 +288,14 @@ if minetest.global_exists("irc") then
|
||||||
local bbrace = color .. ">" .. clear
|
local bbrace = color .. ">" .. clear
|
||||||
return ("%s%s%s %s"):format(abrace, name, bbrace, message)
|
return ("%s%s%s %s"):format(abrace, name, bbrace, message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
me_func = function(...)
|
||||||
|
local message = irc.playerMessage(...)
|
||||||
|
|
||||||
|
message = "*" .. message:sub(message:find(" "))
|
||||||
|
|
||||||
|
irc.say(message)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local handler
|
local handler
|
||||||
|
@ -320,5 +330,6 @@ minetest.registered_chatcommands["me"].func = function(name, param)
|
||||||
name = "* ".. name
|
name = "* ".. name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
me_func(name, param)
|
||||||
minetest.chat_send_all(name .. " " .. param)
|
minetest.chat_send_all(name .. " " .. param)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue