mirror of
https://github.com/minetest-mods/irc_commands.git
synced 2025-01-09 15:20:19 +01:00
Send messages from minetest.chat_send_player() to a user in irc if they are loged in
This commit is contained in:
parent
8d5af54830
commit
94ecfb9204
10
init.lua
10
init.lua
@ -1,5 +1,15 @@
|
|||||||
irc_users = {}
|
irc_users = {}
|
||||||
|
|
||||||
|
local old_chat_send_player = minetest.chat_send_player
|
||||||
|
minetest.chat_send_player = function(name, message)
|
||||||
|
for nick, user in pairs(irc_users) do
|
||||||
|
if name == user then
|
||||||
|
mt_irc.say(nick, message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return old_chat_send_player(name, message)
|
||||||
|
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