forked from minetest-mods/irc_commands
Corrige avertissements sur appels obsolètes de fonctions
This commit is contained in:
parent
d80004c524
commit
68017484bf
16
init.lua
16
init.lua
@ -11,7 +11,7 @@ minetest.chat_send_player = function(name, message)
|
|||||||
return old_chat_send_player(name, message)
|
return old_chat_send_player(name, message)
|
||||||
end
|
end
|
||||||
|
|
||||||
irc:register_hook("NickChange", function(user, newNick)
|
irc.register_hook("NickChange", function(user, newNick)
|
||||||
for nick, player in pairs(irc_users) do
|
for nick, player in pairs(irc_users) do
|
||||||
if nick == user.nick then
|
if nick == user.nick then
|
||||||
irc_users[newNick] = irc_users[user.nick]
|
irc_users[newNick] = irc_users[user.nick]
|
||||||
@ -20,19 +20,19 @@ irc:register_hook("NickChange", function(user, newNick)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
irc:register_hook("OnPart", function(user, channel, reason)
|
irc.register_hook("OnPart", function(user, channel, reason)
|
||||||
irc_users[user.nick] = nil
|
irc_users[user.nick] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
irc:register_hook("OnKick", function(user, channel, target, reason)
|
irc.register_hook("OnKick", function(user, channel, target, reason)
|
||||||
irc_users[target] = nil
|
irc_users[target] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
irc:register_hook("OnQuit", function(user, reason)
|
irc.register_hook("OnQuit", function(user, reason)
|
||||||
irc_users[user.nick] = nil
|
irc_users[user.nick] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
irc:register_bot_command("login", {
|
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",
|
||||||
func = function(user, args)
|
func = function(user, args)
|
||||||
@ -74,7 +74,7 @@ irc:register_bot_command("login", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
irc:register_bot_command("logout", {
|
irc.register_bot_command("logout", {
|
||||||
description = "Logout",
|
description = "Logout",
|
||||||
func = function (user, args)
|
func = function (user, args)
|
||||||
if irc_users[user.nick] then
|
if irc_users[user.nick] then
|
||||||
@ -88,7 +88,7 @@ irc:register_bot_command("logout", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
irc:register_bot_command("cmd", {
|
irc.register_bot_command("cmd", {
|
||||||
params = "<command>",
|
params = "<command>",
|
||||||
description = "Run a command on the server",
|
description = "Run a command on the server",
|
||||||
func = function (user, args)
|
func = function (user, args)
|
||||||
@ -115,7 +115,7 @@ irc:register_bot_command("cmd", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
irc:register_bot_command("say", {
|
irc.register_bot_command("say", {
|
||||||
params = "message",
|
params = "message",
|
||||||
description = "Say something",
|
description = "Say something",
|
||||||
func = function (user, args)
|
func = function (user, args)
|
||||||
|
Loading…
Reference in New Issue
Block a user