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."
|
||||
end
|
||||
local inChannel = false
|
||||
local users = irc.conn.channels[irc.config.channel].users
|
||||
for cnick, cuser in pairs(users) do
|
||||
local channel = irc.conn.channels[irc.config.channel]
|
||||
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
|
||||
inChannel = true
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue
Block a user