mirror of
https://github.com/minetest-mods/irc.git
synced 2025-07-01 07:30:30 +02:00
Added /irc_disconnect and /irc_reconnect
This commit is contained in:
@ -36,6 +36,35 @@ minetest.register_chatcommand("irc_connect", {
|
||||
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", {
|
||||
params = "";
|
||||
description = "Join the IRC channel";
|
||||
|
@ -133,6 +133,8 @@ mt_irc.say = function ( to, msg )
|
||||
irc.say(to, msg);
|
||||
end
|
||||
|
||||
mt_irc._irc = irc;
|
||||
|
||||
dofile(MODPATH.."/callback.lua");
|
||||
dofile(MODPATH.."/chatcmds.lua");
|
||||
dofile(MODPATH.."/botcmds.lua");
|
||||
|
Reference in New Issue
Block a user