Add support for sending output from commands to IRC

This commit is contained in:
Diego Martínez 2013-03-26 11:53:30 -03:00
parent 8d5af54830
commit 3d637685a0

View File

@ -50,7 +50,12 @@ mt_irc.register_bot_command("command", {
return return
end end
if minetest.check_player_privs(irc_users[from], command.privs) then if minetest.check_player_privs(irc_users[from], command.privs) then
local send = minetest.chat_send_player
minetest.chat_send_player = function(name, message)
mt_irc.say(name, message)
end
command.func(irc_users[from], (params or "")) command.func(irc_users[from], (params or ""))
minetest.chat_send_player = send
mt_irc.say(from, "Command run successfuly") mt_irc.say(from, "Command run successfuly")
end end
end}) end})