mirror of
https://github.com/minetest-mods/irc.git
synced 2024-11-05 01:30:19 +01:00
Fixed crash when requesting help for unknown command with !help
This commit is contained in:
parent
33a16ac395
commit
9eb893e50a
|
@ -5,6 +5,7 @@ mt_irc.bot_help = function ( from, cmdname )
|
|||
local cmd = mt_irc.bot_commands[cmdname];
|
||||
if (not cmd) then
|
||||
irc.say(from, "Unknown command `"..cmdname.."'");
|
||||
return;
|
||||
end
|
||||
local usage = "Usage: !"..cmdname;
|
||||
if (cmd.params) then usage = usage.." "..cmd.params; end
|
||||
|
|
|
@ -206,6 +206,8 @@ irc.handlers.on_err_nicknameinuse = function ( from, respond_to )
|
|||
end
|
||||
mt_irc.got_motd = false;
|
||||
mt_irc.connect_ok = false;
|
||||
mt_irc.server_nick = mt_irc.server_nick:sub(1, -2)..math.floor(math.random(10));
|
||||
local n = (tonumber(mt_irc.server_nick:sub(-1)) or 0) + 1;
|
||||
if (n == 10) then n = 1; end
|
||||
mt_irc.server_nick = mt_irc.server_nick:sub(1, -2)..n;
|
||||
mt_irc.connect();
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user