mirror of
https://github.com/minetest-mods/irc.git
synced 2024-11-05 01:30:19 +01:00
Various Fixes
This commit is contained in:
parent
9de98a8e8b
commit
9ac5f86475
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -5,3 +5,5 @@ irc
|
|||
*.zip
|
||||
*.tar.gz
|
||||
*.tar.bz2
|
||||
*.marks
|
||||
screenshot_*.png
|
||||
|
|
|
@ -20,6 +20,8 @@ mt_irc.register_bot_command = function ( name, def )
|
|||
end
|
||||
|
||||
mt_irc.register_bot_command("help", {
|
||||
params = "[<command>]";
|
||||
description = "Get help about a command";
|
||||
func = function ( from, args )
|
||||
if (args ~= "") then
|
||||
mt_irc.bot_help(from, args);
|
||||
|
@ -35,6 +37,8 @@ mt_irc.register_bot_command("help", {
|
|||
});
|
||||
|
||||
mt_irc.register_bot_command("who", {
|
||||
params = nil;
|
||||
description = "Tell who is playing";
|
||||
func = function ( from, args )
|
||||
local s = "";
|
||||
for k, v in pairs(mt_irc.connected_players) do
|
||||
|
@ -47,6 +51,8 @@ mt_irc.register_bot_command("who", {
|
|||
});
|
||||
|
||||
mt_irc.register_bot_command("whereis", {
|
||||
params = "<player>";
|
||||
description = "Tell the location of <player>";
|
||||
|
||||
func = function ( from, args )
|
||||
if (args == "") then
|
||||
|
|
|
@ -79,3 +79,12 @@ minetest.register_chatcommand("who", {
|
|||
minetest.chat_send_player(name, "Players On Channel:"..s);
|
||||
end;
|
||||
});
|
||||
|
||||
minetest.register_chatcommand("uptime", {
|
||||
params = "";
|
||||
description = "Tell how much time the server has been up";
|
||||
privs = { shout=true; };
|
||||
func = function ( name, param )
|
||||
local t = os.time();
|
||||
end;
|
||||
});
|
||||
|
|
10
src/init.lua
10
src/init.lua
|
@ -123,6 +123,16 @@ mt_irc.connect = function ( )
|
|||
end
|
||||
end
|
||||
|
||||
mt_irc.say = function ( to, msg )
|
||||
if (not msg) then
|
||||
msg = to;
|
||||
to = mt_irc.channel;
|
||||
end
|
||||
to = to or mt_irc.channel;
|
||||
msg = msg or "";
|
||||
irc.say(to, msg);
|
||||
end
|
||||
|
||||
dofile(MODPATH.."/callback.lua");
|
||||
dofile(MODPATH.."/chatcmds.lua");
|
||||
dofile(MODPATH.."/botcmds.lua");
|
||||
|
|
Loading…
Reference in New Issue
Block a user