Add option to broadcast kick messages.

Default value is false.
This commit is contained in:
Diego Martínez 2017-02-21 02:07:36 -03:00
parent 78fbe26a2c
commit 2f55e0f9a0
3 changed files with 17 additions and 0 deletions

View File

@ -119,3 +119,16 @@ minetest.chatcommands["me"].func = function(name, param, ...)
return oldme(name, param, ...)
end
if irc.config.send_kicks and minetest.chatcommands["kick"] then
local oldkick = minetest.chatcommands["kick"].func
-- luacheck: ignore
minetest.chatcommands["kick"].func = function(name, param, ...)
local plname, reason = param:match("^(%S+)%s*(.*)$")
if not plname then
return false, "Usage: /kick player [reason]"
end
irc:say(("*** Kicked %s.%s"):format(name,
reason~="" and " Reason: "..reason or ""))
return oldkick(name, param, ...)
end
end

View File

@ -36,6 +36,7 @@ setting("string", "sasl.pass") -- SASL password
setting("string", "channel", nil, true) -- Channel to join
setting("string", "key") -- Key for the channel
setting("bool", "send_join_part", true) -- Whether to send player join and part messages to the channel
setting("bool", "send_kicks", false) -- Whether to send player kicked messages to the channel
-----------------------
-- ADVANCED SETTINGS --

View File

@ -53,6 +53,9 @@ irc.sasl.pass (SASL password) string
# or leave the game server.
irc.send_join_part (Send join and part messages) bool true
# Enable this to make the bot send messages when players are kicked.
irc.send_kicks (Send kick messages) bool false
# Underlying socket timeout in seconds.
irc.timeout (Timeout) int 60 1