2 Commits

Author SHA1 Message Date
s20
c088ba4e40 Add number of connected players to players command (#73) 2023-11-04 18:56:07 +01:00
758e9b6361 Fix error caused by ident check notice (#71)
Fixed the error where it cannot find an user at the notice hook. 
It happened when you get the `NOTICE * :*** Looking up your hostname and checking ident`
Because `*` is not in the `<nick>!<ident>@<host>`
2022-03-23 22:13:51 +01:00
2 changed files with 5 additions and 3 deletions

View File

@ -169,8 +169,10 @@ irc.register_bot_command("players", {
for _, player in pairs(players) do
table.insert(names, player:get_player_name())
end
return true, "Connected players: "
..table.concat(names, ", ")
return true, string.format("%d connected player(s): %s",
#players,
table.concat(names, ", ")
)
end
})

View File

@ -171,7 +171,7 @@ end
function irc.hooks.notice(user, target, message)
if user.nick and target == irc.config.channel then
if user and user.nick and target == irc.config.channel then
irc.sendLocal("-"..user.nick.."@IRC- "..message)
end
end