forked from minetest-mods/irc
Add option to broadcast kick messages.
Default value is false.
This commit is contained in:
parent
78fbe26a2c
commit
2f55e0f9a0
13
chatcmds.lua
13
chatcmds.lua
@ -119,3 +119,16 @@ minetest.chatcommands["me"].func = function(name, param, ...)
|
|||||||
return oldme(name, param, ...)
|
return oldme(name, param, ...)
|
||||||
end
|
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", "channel", nil, true) -- Channel to join
|
||||||
setting("string", "key") -- Key for the channel
|
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_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 --
|
-- ADVANCED SETTINGS --
|
||||||
|
@ -53,6 +53,9 @@ irc.sasl.pass (SASL password) string
|
|||||||
# or leave the game server.
|
# or leave the game server.
|
||||||
irc.send_join_part (Send join and part messages) bool true
|
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.
|
# Underlying socket timeout in seconds.
|
||||||
irc.timeout (Timeout) int 60 1
|
irc.timeout (Timeout) int 60 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user