forked from minetest-mods/irc_commands
Logout when a user quits and follow nick changes
This commit is contained in:
parent
a14d46155a
commit
ad3d067587
15
init.lua
15
init.lua
@ -10,6 +10,21 @@ minetest.chat_send_player = function(name, message)
|
|||||||
return old_chat_send_player(name, message)
|
return old_chat_send_player(name, message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
mt_irc.register_callback("nick_change", function (old_nick, new_nick)
|
||||||
|
for nick, user in pairs(irc_users) do
|
||||||
|
if nick == old_nick then
|
||||||
|
irc_users[new_nick] = irc_users[old_nick]
|
||||||
|
irc_users[old_nick] = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
mt_irc.register_callback("part", function (nick, part_msg)
|
||||||
|
if irc_users[nick] then
|
||||||
|
irc_users[nick] = nil
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
mt_irc.register_bot_command("login", {
|
mt_irc.register_bot_command("login", {
|
||||||
params = "<username> <password>",
|
params = "<username> <password>",
|
||||||
description = "Login as a user to run commands",
|
description = "Login as a user to run commands",
|
||||||
|
Loading…
Reference in New Issue
Block a user