forked from minetest-mods/irc_commands
Check that the server is in its channel
This commit is contained in:
parent
22e523cc7a
commit
0e79e91fd2
8
init.lua
8
init.lua
@ -44,8 +44,12 @@ irc:register_bot_command("login", {
|
|||||||
return false, "Player name and password required."
|
return false, "Player name and password required."
|
||||||
end
|
end
|
||||||
local inChannel = false
|
local inChannel = false
|
||||||
local users = irc.conn.channels[irc.config.channel].users
|
local channel = irc.conn.channels[irc.config.channel]
|
||||||
for cnick, cuser in pairs(users) do
|
if not channel then
|
||||||
|
return false, "The server needs to be in its "..
|
||||||
|
"channel for anyone to log in."
|
||||||
|
end
|
||||||
|
for cnick, cuser in pairs(channel.users) do
|
||||||
if user.nick == cnick then
|
if user.nick == cnick then
|
||||||
inChannel = true
|
inChannel = true
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user