mirror of
https://github.com/minetest-mods/irc.git
synced 2024-12-28 09:40:17 +01:00
Added /irc_disconnect and /irc_reconnect
This commit is contained in:
parent
ff14ed3153
commit
873fab6d36
13
README.txt
13
README.txt
@ -118,9 +118,16 @@ All settings are changed in the `config.lua' file. If any of these settings
|
|||||||
mt_irc.debug (boolean, default false)
|
mt_irc.debug (boolean, default false)
|
||||||
Whether to output debug information.
|
Whether to output debug information.
|
||||||
|
|
||||||
mt_irc.connect_on_join (boolean, default false)
|
mt_irc.auto_connect (boolean, default false)
|
||||||
If true, players are connected by default. If false, players
|
If true, the bot is connected by default. If false, a player with
|
||||||
have to use the /irc_connect command to connect to the server.
|
`irc_admin' privilege has to use the /irc_connect command to
|
||||||
|
connect to the server.
|
||||||
|
|
||||||
|
mt_irc.auto_connect (boolean, default false)
|
||||||
|
If true, players join the channel automatically upon entering the
|
||||||
|
game. If false, each user must manually use the /join command to
|
||||||
|
join the channel. In any case, the players may use the /part
|
||||||
|
command to opt-out of being in the channel.
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
-----
|
-----
|
||||||
|
@ -36,6 +36,35 @@ minetest.register_chatcommand("irc_connect", {
|
|||||||
end;
|
end;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
minetest.register_chatcommand("irc_disconnect", {
|
||||||
|
params = "";
|
||||||
|
description = "Disconnect from the IRC server";
|
||||||
|
privs = { irc_admin=true; };
|
||||||
|
func = function ( name, param )
|
||||||
|
if (not mt_irc.connect_ok) then
|
||||||
|
minetest.chat_send_player(name, "IRC: You are not connected.");
|
||||||
|
return;
|
||||||
|
end
|
||||||
|
irc.quit("Manual BOT Disconnection");
|
||||||
|
minetest.chat_send_player(name, "IRC: You are now disconnected.");
|
||||||
|
mt_irc.connect_ok = false;
|
||||||
|
end;
|
||||||
|
});
|
||||||
|
|
||||||
|
minetest.register_chatcommand("irc_reconnect", {
|
||||||
|
params = "";
|
||||||
|
description = "Reconnect to the IRC server";
|
||||||
|
privs = { irc_admin=true; };
|
||||||
|
func = function ( name, param )
|
||||||
|
if (mt_irc.connect_ok) then
|
||||||
|
irc.quit("Reconnecting BOT...");
|
||||||
|
minetest.chat_send_player(name, "IRC: Reconnecting bot...");
|
||||||
|
mt_irc.connect_ok = false;
|
||||||
|
end
|
||||||
|
mt_irc.connect();
|
||||||
|
end;
|
||||||
|
});
|
||||||
|
|
||||||
minetest.register_chatcommand("join", {
|
minetest.register_chatcommand("join", {
|
||||||
params = "";
|
params = "";
|
||||||
description = "Join the IRC channel";
|
description = "Join the IRC channel";
|
||||||
|
@ -133,6 +133,8 @@ mt_irc.say = function ( to, msg )
|
|||||||
irc.say(to, msg);
|
irc.say(to, msg);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
mt_irc._irc = irc;
|
||||||
|
|
||||||
dofile(MODPATH.."/callback.lua");
|
dofile(MODPATH.."/callback.lua");
|
||||||
dofile(MODPATH.."/chatcmds.lua");
|
dofile(MODPATH.."/chatcmds.lua");
|
||||||
dofile(MODPATH.."/botcmds.lua");
|
dofile(MODPATH.."/botcmds.lua");
|
||||||
|
Loading…
Reference in New Issue
Block a user