Skip to content
Snippets Groups Projects
Commit 2f55e0f9 authored by Diego Martínez's avatar Diego Martínez
Browse files

Add option to broadcast kick messages.

Default value is false.
parent 78fbe26a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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 --
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment